diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 33 | ||||
-rw-r--r-- | cpp/src/Ice/LoggerI.h | 3 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rw-r--r-- | cpp/src/IceUtil/Time.cpp | 4 |
6 files changed, 10 insertions, 39 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index db14bc47ca0..8cf07bdf2e4 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -592,9 +592,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi #endif else { - _initData.logger = - new LoggerI(_initData.properties->getProperty("Ice.ProgramName"), - _initData.properties->getPropertyWithDefault("Ice.Logger.DateFormat", "%x %H:%M:%S")); + _initData.logger = new LoggerI(_initData.properties->getProperty("Ice.ProgramName")); } } diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index cd83067a25f..849ff249634 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -17,18 +17,12 @@ using namespace IceInternal; static IceUtil::StaticMutex outputMutex = ICE_STATIC_MUTEX_INITIALIZER; -Ice::LoggerI::LoggerI(const string& prefix, const string& dateFormat) : - _dateFormat(dateFormat) +Ice::LoggerI::LoggerI(const string& prefix) { if(!prefix.empty()) { _prefix = prefix + ": "; } - - if(_dateFormat == "0") - { - _dateFormat = ""; - } } void @@ -42,12 +36,7 @@ Ice::LoggerI::print(const string& message) void Ice::LoggerI::trace(const string& category, const string& message) { - string s = "[ "; - if(!_dateFormat.empty()) - { - s += IceUtil::Time::now().toDateTime(_dateFormat) + " "; - } - s += _prefix; + string s = "[ " + IceUtil::Time::now().toDateTime() + " " + _prefix; if(!category.empty()) { s += category + ": "; @@ -69,29 +58,15 @@ Ice::LoggerI::trace(const string& category, const string& message) void Ice::LoggerI::warning(const string& message) { - string s; - if(!_dateFormat.empty()) - { - s += IceUtil::Time::now().toDateTime(_dateFormat) + " "; - } - s += _prefix + "warning: " + message; - IceUtil::StaticMutex::Lock sync(outputMutex); - cerr << s << endl; + cerr << IceUtil::Time::now().toDateTime() << _prefix << "warning: " << message << endl; } void Ice::LoggerI::error(const string& message) { - string s; - if(!_dateFormat.empty()) - { - s += IceUtil::Time::now().toDateTime(_dateFormat) + " "; - } - s += _prefix + "error: " + message; - IceUtil::StaticMutex::Lock sync(outputMutex); - cerr << s << endl; + cerr << IceUtil::Time::now().toDateTime() << _prefix << "error: " << message << endl; } diff --git a/cpp/src/Ice/LoggerI.h b/cpp/src/Ice/LoggerI.h index 503f1f0498a..aa643e8a43b 100644 --- a/cpp/src/Ice/LoggerI.h +++ b/cpp/src/Ice/LoggerI.h @@ -19,7 +19,7 @@ class LoggerI : public Logger { public: - LoggerI(const std::string&, const std::string&); + LoggerI(const std::string&); virtual void print(const std::string&); virtual void trace(const std::string&, const std::string&); @@ -29,7 +29,6 @@ public: private: std::string _prefix; - std::string _dateFormat; }; } diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index 689abfb4e7b..229406d2267 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `./config/PropertyNames.def', Tue Dec 19 14:18:06 2006 +// Generated by makeprops.py from file `./config/PropertyNames.def', Wed Dec 20 11:12:28 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -46,7 +46,6 @@ const char* IceInternal::PropertyNames::IceProps[] = "Ice.GC.Interval", "Ice.ImplicitContext", "Ice.InitPlugins", - "Ice.Logger.DateFormat", "Ice.LoggerPlugin", "Ice.MessageSizeMax", "Ice.MonitorConnections", diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 048378dda62..3f6f1ef97d3 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `./config/PropertyNames.def', Tue Dec 19 14:18:06 2006 +// Generated by makeprops.py from file `./config/PropertyNames.def', Wed Dec 20 11:12:28 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/IceUtil/Time.cpp b/cpp/src/IceUtil/Time.cpp index 22f963f4073..127dc68f845 100644 --- a/cpp/src/IceUtil/Time.cpp +++ b/cpp/src/IceUtil/Time.cpp @@ -110,7 +110,7 @@ IceUtil::Time::toMicroSecondsDouble() const } std::string -IceUtil::Time::toDateTime(const std::string& format) const +IceUtil::Time::toDateTime() const { time_t time = static_cast<long>(_usec / 1000000); @@ -124,7 +124,7 @@ IceUtil::Time::toDateTime(const std::string& format) const #endif char buf[32]; - strftime(buf, sizeof(buf), format.c_str(), t); + strftime(buf, sizeof(buf), "%x %H:%M:%S", t); std::ostringstream os; os << buf << "."; |