From 18748d529095d3ab86e3dc42abfd2b5f4946f9a7 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 14 Aug 2014 16:38:21 -0400 Subject: 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) --- cpp/src/Ice/Service.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'cpp/src/Ice/Service.cpp') diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 4fca9da3e36..f3271be7cb8 100644 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -187,6 +187,12 @@ public: _logger->error(_prefix, message); } + virtual string + getPrefix() + { + return _prefix; + } + virtual Ice::LoggerPtr cloneWithPrefix(const string& prefix) { @@ -196,10 +202,10 @@ public: private: SMEventLoggerPtr _logger; - string _prefix; + const string _prefix; }; -class SMEventLoggerI : public Ice::Logger, public SMEventLogger +class SMEventLoggerI : public SMEventLogger { public: @@ -317,14 +323,14 @@ public: print(s); } - virtual void + void print(const string& message) { // // Don't need to use a wide string converter as the wide string is passed // to Windows API. // - wstring msg = IceUtil::stringToWstring(message, _stringConverter); + wstring msg = IceUtil::stringToWstring(message, _stringConverter); const wchar_t* messages[1]; messages[0] = msg.c_str(); // @@ -347,7 +353,7 @@ public: trace(prefix, s); } - virtual void + void trace(const string& category, const string& message) { string s; @@ -362,7 +368,7 @@ public: // Don't need to use a wide string converter as the wide string is passed // to Windows API. // - wstring msg = IceUtil::stringToWstring(s, _stringConverter); + wstring msg = IceUtil::stringToWstring(s, _stringConverter); const wchar_t* messages[1]; messages[0] = msg.c_str(); // @@ -385,14 +391,14 @@ public: warning(s); } - virtual void + void warning(const string& message) { // // Don't need to use a wide string converter as the wide string is passed // to Windows API. // - wstring msg = IceUtil::stringToWstring(message, _stringConverter); + wstring msg = IceUtil::stringToWstring(message, _stringConverter); const wchar_t* messages[1]; messages[0] = msg.c_str(); // @@ -415,14 +421,14 @@ public: error(s); } - virtual void + void error(const string& message) { // // Don't need to use a wide string converter as the wide string is passed // to Windows API. // - wstring msg = IceUtil::stringToWstring(message, _stringConverter); + wstring msg = IceUtil::stringToWstring(message, _stringConverter); const wchar_t* messages[1]; messages[0] = msg.c_str(); // @@ -432,12 +438,6 @@ public: ReportEventW(_source, EVENTLOG_ERROR_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0); } - virtual Ice::LoggerPtr - cloneWithPrefix(const string& prefix) - { - return new SMEventLoggerIWrapper(this, prefix); - } - static void setModuleHandle(HMODULE module) { -- cgit v1.2.3