28namespace msparser_internal {
29 class ms_loggingmonitor_impl;
32namespace matrix_science {
74 SRC_VENDORSTART = 100,
79 msparser_internal::ms_loggingmonitor_impl *pImpl_;
90 virtual int addLogEventsHandler(
ms_logger& logger);
93 virtual bool removeLogEventsHandler(
const int uid);
96 virtual ms_logger * getLogEventsHandler(
const int uid);
99 virtual int getNumLogEventsHandlers()
const;
105 const std::string & text,
106 const char * srcFileName,
107 const int srcFileLineNum,
108 long lContextId=0)
const;
111 virtual long getLogMask(
unsigned source = SRC_ALL);
114 virtual void setLogMask(
long newVal,
unsigned source = SRC_ALL);
122 static std::string messageSourceAsText(
Source_e eSource);
125 static std::string severityAsText(
Level_e eSeverity);
152 COL_ASC_TIME = 0x0001,
153 COL_ISO8601_TIME = 0x0002,
154 COL_IP_ADDRESS = 0x0004,
155 COL_MSG_NUM_DEC = 0x0008,
156 COL_MSG_NUM_HEX = 0x0010,
157 COL_SEVERITY_NUM = 0x0020,
158 COL_SEVERITY_TXT = 0x0040,
159 COL_MSG_SOURCE_TXT = 0x0080,
160 COL_SRC_FILE = 0x0100,
161 COL_SRC_LINENUM = 0x0200,
162 COL_THREAD_ID = 0x0400,
167 COL_HEADERS = 0x4000,
169 COL_LOGGER_DEFAULTS = COL_ISO8601_TIME | COL_MSG_NUM_HEX | COL_SEVERITY_TXT | COL_MSG_SOURCE_TXT | COL_SRC_FILE | COL_SRC_LINENUM | COL_MSG | COL_HEADERS
173 ms_logger(
const unsigned int colsToOutput = COL_MSG);
182 const std::string & text,
183 const char * srcFileName,
184 const int srcFileLineNum,
185 long lContextId=0)=0;
188 virtual unsigned int getColsToOutput()
const;
191 virtual void setColsToOutput(
const unsigned int colsToOutput);
197 const std::string & text,
198 const char * srcFileName,
199 const int srcFileLineNum,
200 long lContextId)
const;
203 std::string getHeaderLine()
const;
206 unsigned int colsToOutput_;
213 ms_stdout_logger(
unsigned int colsToOutput = ms_logger::COL_LOGGER_DEFAULTS);
221 const std::string & text,
222 const char * srcFileName,
223 const int srcFileLineNum,
232 ms_file_logger(
const std::string logFileName,
unsigned int colsToOutput = ms_logger::COL_LOGGER_DEFAULTS);
238 std::string getLogFilename();
244 const std::string & text,
245 const char * srcFileName,
246 const int srcFileLineNum,
250 std::string logfilename_;
258 ms_buffer_logger(
unsigned int colsToOutput = ms_logger::COL_LOGGER_DEFAULTS);
264 std::vector<std::string> flush();
270 const std::string & text,
271 const char * srcFileName,
272 const int srcFileLineNum,
276 std::list<std::string> messages_;
277 std::list<std::string>::size_type numMessages_;
Concrete class which implements ms_logger and stores log text in memory.
Definition: ms_logging.hpp:255
Concrete class which implements ms_logger and outputs log text to the specified file.
Definition: ms_logging.hpp:229
Abstract class which provides the interface used by ms_logging monitor to delegate logging events.
Definition: ms_logging.hpp:137
virtual ~ms_logger()
Destructor.
Definition: ms_logging.hpp:176
LogOutputColumns_e
Logging output columns.
Definition: ms_logging.hpp:151
virtual void onLogMessage(ms_loggingmonitor::Level_e eSeverity, ms_loggingmonitor::Source_e eSource, long lMsgId, const std::string &text, const char *srcFileName, const int srcFileLineNum, long lContextId=0)=0
Processes and handles the passed logging message.
Monitor class to delegate logging events generated from multiple sources.
Definition: ms_logging.hpp:44
Level_e
Logging severity levels.
Definition: ms_logging.hpp:51
Source_e
Logging event source.
Definition: ms_logging.hpp:65
virtual void logMessage(Level_e eSeverity, Source_e eSource, long lMsgId, const std::string &text, const char *srcFileName, const int srcFileLineNum, long lContextId=0) const
Logs the passed message with all registered ms_logger objects.
Concrete class which implements ms_logger and outputs log text to standard out.
Definition: ms_logging.hpp:210