xmscore  1.0
xms::XmLog Class Reference

  
 More...

#include <XmLog.h>

Inheritance diagram for xms::XmLog:
xms::Singleton< XmLog >

Classes

class  Impl
 implementation of XmLog More...
 

Public Member Functions

 ~XmLog ()
 destructor
 
void Log (const char *const a_file, int a_line, xmlog::MessageTypeEnum a_level, std::string a_message)
 Logs. More...
 
int ErrCount ()
 Returns the current count of the error stack. More...
 
MessageStack GetAndClearStack ()
 Returns a copy of the error stack before clearing it. More...
 
std::string GetAndClearStackStr ()
 Clears the error stack and returns its contents as a string. More...
 

Static Public Member Functions

static XmLogFilenameCallbackLogFilenameCallback ()
 Set the callback that returns the log filename. More...
 
static std::string LogFilename ()
 Return the name of the log file. More...
 
- Static Public Member Functions inherited from xms::Singleton< XmLog >
static XmLogInstance (bool a_delete=false, XmLog *a_new=NULL)
 Get the instance of the singleton. More...
 
static void Delete ()
 Delete the singleton instance.
 

Private Member Functions

 XmLog ()
 Constructor hidden and not implemented. More...
 

Private Attributes

friend Singleton< XmLog >
 Allow Singleton access to private members.
 
boost::scoped_ptr< Implm
 Implementation pointer.
 

Detailed Description

 

Class for logging messages.

Definition at line 112 of file XmLog.h.

Constructor & Destructor Documentation

◆ XmLog()

xms::XmLog::XmLog ( )
private

Constructor hidden and not implemented.

constructor

Definition at line 139 of file XmLog.cpp.

References LogFilename().

Member Function Documentation

◆ ErrCount()

int xms::XmLog::ErrCount ( )

Returns the current count of the error stack.

Returns
Current count of the error stack.

Definition at line 220 of file XmLog.cpp.

References m.

◆ GetAndClearStack()

MessageStack xms::XmLog::GetAndClearStack ( )

Returns a copy of the error stack before clearing it.

Returns
MessageStack.

Definition at line 238 of file XmLog.cpp.

References m.

◆ GetAndClearStackStr()

std::string xms::XmLog::GetAndClearStackStr ( )

Clears the error stack and returns its contents as a string.

Returns
Contents of the error stack as a string.

Definition at line 228 of file XmLog.cpp.

References m.

Referenced by xms::ttAssertStackedErrors().

◆ Log()

void xms::XmLog::Log ( const char *const  a_file,
int  a_line,
xmlog::MessageTypeEnum  a_level,
std::string  a_message 
)

Logs.

Parameters
a_fileSource file name
a_lineline number in source file name
a_levelLowest Severity level of the logged item
a_messageMessage to log

Definition at line 190 of file XmLog.cpp.

References xmlog::debug, m, and XM_LOG.

◆ LogFilename()

std::string xms::XmLog::LogFilename ( )
static

Return the name of the log file.

Static because the XmLog constructor needs it, so we must set LogFilenameCallback BEFORE we construct the XmLog singleton.

Returns
The name of the log file.

Definition at line 262 of file XmLog.cpp.

References LogFilenameCallback().

Referenced by xms::iTest_XM_LOG_debug(), xms::iTest_XM_LOG_stackable(), and XmLog().

◆ LogFilenameCallback()

XmLogFilenameCallback & xms::XmLog::LogFilenameCallback ( )
static

Set the callback that returns the log filename.

Static because the XmLog constructor needs it, so we must set it BEFORE we construct the XmLog singleton.

Returns
The callback.

Definition at line 251 of file XmLog.cpp.

Referenced by LogFilename().


The documentation for this class was generated from the following files: