diff options
author | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-13 17:53:01 +0000 |
---|---|---|
committer | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-13 17:53:01 +0000 |
commit | 3a88c2e0159ec9bb27f37eb78014628ad7ca0f95 (patch) | |
tree | 8c16679e9ae0c1da59d3feb26ac7c3038f87f240 | |
parent | 6d28d42ce97f3dc4601dd69e461ecdda8829e84b (diff) | |
download | ATCD-3a88c2e0159ec9bb27f37eb78014628ad7ca0f95.tar.gz |
See Fri Nov 13 11:51:21 1998 Matthew J Braun <mjb2@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-98c | 5 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp | 58 |
2 files changed, 11 insertions, 52 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 9decd9e22a7..2c1f00bcadd 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,8 @@ +Fri Nov 13 11:51:21 1998 Matthew J Braun <mjb2@cs.wustl.edu> + + * orbsvcs/orbsvcs/Log/Logger_i.cpp: Modified to reuse code a + little better + Thu Nov 12 23:21:26 1998 Irfan Pyarali <irfan@cs.wustl.edu> * tao/orbconf.h: Native exceptions seem to be working fine. I diff --git a/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp index 5e9a9270640..f84d102b317 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Logger_i.cpp @@ -126,67 +126,22 @@ Logger_i::log (const Logger::Log_Record &log_rec, } void -Logger_i::logv (const Logger::Log_Record &log_rec, - Logger::Verbosity_Level verbosity, +Logger_i::log2 (const Logger::Log_Record &log_rec, CORBA::Environment &_env) { - ACE_Time_Value temp (log_rec.time); - - // Create an <ACE_Log_Record> to leverage existing logging - // code. Since Logger::Log_Priority enum tags don't cleanly map to - // ACE_Log_Priority tags, <priority_conversion> is used to coerce - // the mapping. - ACE_Log_Record rec (this->priority_conversion (log_rec.type), - ACE_Time_Value (log_rec.time), - log_rec.app_id); - - // Create a temporary buffer for manipulating the logging message, - // adding additional space for formatting characters.. - ASYS_TCHAR msgbuf [ACE_MAXLOGMSGLEN + 4]; - - // Format the message for proper display. - ACE_OS::strcpy (msgbuf, "::"); - - // Copy the message data into the temporary buffer - ACE_OS::strncat (msgbuf, - log_rec.msg_data, - ACE_MAXLOGMSGLEN); - - // Set <ACE_Log_Record.msg_data> to the value stored in <msgbuf>. - rec.msg_data (msgbuf); - - CORBA::Long addr = log_rec.host_addr; - - // The constructor for <ACE_INET_Addr> requires a port number, which - // is not relevant in this context, so we give it 0. - ACE_INET_Addr addy (ACE_static_cast (u_short, 0), - ACE_static_cast (ACE_UINT32, - addr)); - - // Create a buffer and fill it with the host name of the logger - ASYS_TCHAR namebuf[MAXHOSTNAMELEN + 1]; - addy.get_host_name (namebuf, - MAXHOSTNAMELEN); - - - u_long verb_level = this->verbosity_conversion (verbosity); - - rec.print (namebuf, - verb_level, - stderr); - // Print out the logging message to stderr with the given level of - // verbosity + this->logv (log_rec, verbosity_level_, _env); } void -Logger_i::log2 (const Logger::Log_Record &log_rec, +Logger_i::logv2 (const Logger::Log_Record &log_rec, + Logger::Verbosity_Level verbosity, CORBA::Environment &_env) { - this->logv2 (log_rec, verbosity_level_, _env); + this->logv (log_rec, verbosity, _env); } void -Logger_i::logv2 (const Logger::Log_Record &log_rec, +Logger_i::logv (const Logger::Log_Record &log_rec, Logger::Verbosity_Level verbosity, CORBA::Environment &_env) { @@ -238,7 +193,6 @@ Logger_i::logv2 (const Logger::Log_Record &log_rec, // verbosity } - Logger::Verbosity_Level Logger_i::verbosity (void) const { |