diff options
author | Michi Henning <michi@zeroc.com> | 2005-01-13 07:16:45 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-01-13 07:16:45 +0000 |
commit | 26d464a9e90ec682765772250e6634be625f42d1 (patch) | |
tree | 92a2f0370e758f28db8283b1442d4e511df61462 /cpp/src/Ice/LoggerI.cpp | |
parent | Fixed bug in the way the arguments were passed to a service. I'm not sure (diff) | |
download | ice-26d464a9e90ec682765772250e6634be625f42d1.tar.bz2 ice-26d464a9e90ec682765772250e6634be625f42d1.tar.xz ice-26d464a9e90ec682765772250e6634be625f42d1.zip |
Added print() operation to Ice::Logger and changed icepatch2server to use
logger instead of writing to stderr.
Diffstat (limited to 'cpp/src/Ice/LoggerI.cpp')
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index aea6e956cc1..8cad1fe486e 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -26,6 +26,14 @@ Ice::LoggerI::LoggerI(const string& prefix, bool timestamp) : } void +Ice::LoggerI::print(const string& message) +{ + IceUtil::Mutex::Lock sync(_globalMutex); + + cerr << message << endl; +} + +void Ice::LoggerI::trace(const string& category, const string& message) { IceUtil::Mutex::Lock sync(_globalMutex); @@ -35,7 +43,12 @@ Ice::LoggerI::trace(const string& category, const string& message) { s += IceUtil::Time::now().toString() + " "; } - s += _prefix + category + ": " + message + " ]"; + s += _prefix; + if(!category.empty()) + { + s += category + ": "; + } + s += message + " ]"; string::size_type idx = 0; while((idx = s.find("\n", idx)) != string::npos) |