Public Types | |
enum | LogTargets { LogToCOUT = 0x0001, LogToOutputDebugString = 0x0010, LogToFile = 0x0100, LogToAll = 0x0111, LogToMemoryBuffer = 0x1000, LogToAllAndMemory = 0x1111 } |
enum | LogEntryFormat { JustMessage = 0x000, IncludeThreadId = 0x001, IncludeSequentialThreadId = 0x002, IncludeThreadName = 0x004, IncludeTimestamp = 0x010, NoNewLogBanner = 0x100 } |
typedef unsigned long | DataLength |
typedef std::vector < std::string > | VectorOfLines |
Logs the messages to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
typedef std::deque < std::string > | DequeOfLines |
Logs the messages to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
Public Member Functions | |
CSimpleMessageLog () | |
CSimpleMessageLog (const _tstring &fileName, DWORD targets=LogToAll, DWORD logEntryFormat=IncludeThreadId) | |
CSimpleMessageLog (const CSimpleMessageLog &rhs) | |
CSimpleMessageLog & | operator= (const CSimpleMessageLog &rhs) |
_tstring | MapThreadIdToLogThreadId (const _tstring &threadId) |
std::string | MapThreadIdToLogThreadIdA (const std::string &threadId) |
_tstring | GetLogMessages () const |
void | SetThreadIdentifier (const std::string &identifier) override |
Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned. | |
void | SetThreadIdentifier (const std::wstring &identifier) override |
Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned. | |
void | SetLogName (const std::string &fileName) override |
Sets the name of the log file to the supplied name. Note that this creates a new log file with the specified name, it does NOT rename the existing log file. Note that you should manually synchronise access to this function and the various LogMessage and IWaitable calls. | |
void | SetLogName (const std::wstring &fileName) override |
Sets the name of the log file to the supplied name. Note that this creates a new log file with the specified name, it does NOT rename the existing log file. Note that you should manually synchronise access to this function and the various LogMessage and IWaitable calls. | |
void | LogMessage (const VectorOfLines &messages) override |
void | LogMessage (const DequeOfLines &messages) override |
void | LogMessage (const std::string &message) override |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
void | LogMessage (const std::wstring &message) override |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
void | LogMessage (const char *pString) override |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
void | LogMessage (const wchar_t *pString) override |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
void | LogMessage (const char *pString, DataLength stringLength) override |
void | LogMessage (const wchar_t *pString, DataLength stringLength) override |
virtual void | LogMessage (const char *pString, DataLength stringLength)=0 |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. | |
virtual void | LogMessage (const wchar_t *pString, DataLength stringLength)=0 |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls. |
typedef unsigned long DataLength [inherited] |
typedef std::vector<std::string> VectorOfLines [inherited] |
Logs the messages to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
typedef std::deque<std::string> DequeOfLines [inherited] |
Logs the messages to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
enum LogTargets |
enum LogEntryFormat |
CSimpleMessageLog | ( | const _tstring & | fileName, | |
DWORD | targets = LogToAll , |
|||
DWORD | logEntryFormat = IncludeThreadId | |||
) | [explicit] |
CSimpleMessageLog | ( | const CSimpleMessageLog & | rhs | ) |
CSimpleMessageLog& operator= | ( | const CSimpleMessageLog & | rhs | ) |
string MapThreadIdToLogThreadIdA | ( | const std::string & | threadId | ) |
_tstring GetLogMessages | ( | ) | const |
void SetThreadIdentifier | ( | const std::string & | identifier | ) | [override, virtual] |
Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.
Implements ILogMessages.
void SetThreadIdentifier | ( | const std::wstring & | identifier | ) | [override, virtual] |
Sets the identifier used in the log for the current thread to the supplied string. The thread identifier defaults to the thread id in the form "XXX: ", the string supplied as an identifier does not need to include the ": " as this will be appended automatically. It can be any string that will help you to identify the thread concerned.
Implements ILogMessages.
void SetLogName | ( | const std::string & | name | ) | [override, virtual] |
Sets the name of the log file to the supplied name. Note that this creates a new log file with the specified name, it does NOT rename the existing log file. Note that you should manually synchronise access to this function and the various LogMessage and IWaitable calls.
Implements ILogMessages.
void SetLogName | ( | const std::wstring & | name | ) | [override, virtual] |
Sets the name of the log file to the supplied name. Note that this creates a new log file with the specified name, it does NOT rename the existing log file. Note that you should manually synchronise access to this function and the various LogMessage and IWaitable calls.
Implements ILogMessages.
void LogMessage | ( | const VectorOfLines & | messages | ) | [override, virtual] |
Implements ILogMessages.
void LogMessage | ( | const DequeOfLines & | messages | ) | [override, virtual] |
Implements ILogMessages.
void LogMessage | ( | const std::string & | message | ) | [override, virtual] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
Implements ILogMessages.
void LogMessage | ( | const std::wstring & | message | ) | [override, virtual] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
Implements ILogMessages.
void LogMessage | ( | const char * | pString | ) | [override, virtual] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
Implements ILogMessages.
void LogMessage | ( | const wchar_t * | pString | ) | [override, virtual] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
Implements ILogMessages.
void LogMessage | ( | const char * | pString, | |
DataLength | stringLength | |||
) | [override] |
void LogMessage | ( | const wchar_t * | pString, | |
DataLength | stringLength | |||
) | [override] |
virtual void LogMessage | ( | const char * | pString, | |
DataLength | stringLength | |||
) | [pure virtual, inherited] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.
virtual void LogMessage | ( | const wchar_t * | pString, | |
DataLength | stringLength | |||
) | [pure virtual, inherited] |
Logs the message to the log. Note that you should manually synchronise access to this function and the various SetLogName calls.