diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-08-14 16:38:21 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-08-14 16:38:21 -0400 |
commit | 18748d529095d3ab86e3dc42abfd2b5f4946f9a7 (patch) | |
tree | 1f343c0790d98e7fbcff50ad94ea5c1e272b2d4f /cpp/src/Ice/LoggerI.cpp | |
parent | Fixed ice_invocationTimout usage in IceDiscovery hello demos (diff) | |
download | ice-18748d529095d3ab86e3dc42abfd2b5f4946f9a7.tar.bz2 ice-18748d529095d3ab86e3dc42abfd2b5f4946f9a7.tar.xz ice-18748d529095d3ab86e3dc42abfd2b5f4946f9a7.zip |
Initial merge for ICE-2400:
- added new Logger admin facet (C++ only)
- this Logger facet allows remote application to retrieve the Ice log file, including recently logged events, with optional filters
- this logger facet also allows remote applications to attach RemoteLogger objects to get new logs as they are generated
- added new "show log" feature to icegridadmin, to retrieve Ice log file of Ice server (not yet implemented for IceGrid registry and node)
Diffstat (limited to 'cpp/src/Ice/LoggerI.cpp')
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index 430d9fd49f6..e3298062478 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -50,6 +50,7 @@ Init init; Ice::LoggerI::LoggerI(const string& prefix, const string& file, bool convert, const IceUtil::StringConverterPtr& converter) : + _prefix(prefix), _convert(convert), _converter(converter) #if defined(_WIN32) && !defined(ICE_OS_WINRT) @@ -59,7 +60,7 @@ Ice::LoggerI::LoggerI(const string& prefix, const string& file, { if(!prefix.empty()) { - _prefix = prefix + ": "; + _formattedPrefix = prefix + ": "; } if(!file.empty()) @@ -90,7 +91,7 @@ Ice::LoggerI::print(const string& message) void Ice::LoggerI::trace(const string& category, const string& message) { - string s = "-- " + IceUtil::Time::now().toDateTime() + " " + _prefix; + string s = "-- " + IceUtil::Time::now().toDateTime() + " " + _formattedPrefix; if(!category.empty()) { s += category + ": "; @@ -103,13 +104,19 @@ Ice::LoggerI::trace(const string& category, const string& message) void Ice::LoggerI::warning(const string& message) { - write("-! " + IceUtil::Time::now().toDateTime() + " " + _prefix + "warning: " + message, true); + write("-! " + IceUtil::Time::now().toDateTime() + " " + _formattedPrefix + "warning: " + message, true); } void Ice::LoggerI::error(const string& message) { - write("!! " + IceUtil::Time::now().toDateTime() + " " + _prefix + "error: " + message, true); + write("!! " + IceUtil::Time::now().toDateTime() + " " + _formattedPrefix + "error: " + message, true); +} + +string +Ice::LoggerI::getPrefix() +{ + return _prefix; } LoggerPtr |