logog
logger optimized for games
|
#include <target.hpp>
Public Member Functions | |
LogFile (const char *sFileName, bool bEnableOutputBuffering=true) | |
virtual | ~LogFile () |
virtual int | Open () |
virtual void | WriteUnicodeBOM () |
virtual int | Output (const LOGOG_STRING &data) |
![]() | |
Target () | |
virtual | ~Target () |
void | SetFormatter (Formatter &formatter) |
Formatter & | GetFormatter () const |
virtual int | Receive (const Topic &topic) |
bool | GetNullTerminatesStrings () const |
void | SetNullTerminatesStrings (bool val) |
![]() | |
virtual bool | IsTopic () const |
virtual void | Initialize () |
virtual bool | PublishTo (Node &) |
virtual bool | UnpublishTo (Node &) |
virtual bool | CanPublish () const |
![]() | |
Topic (const LOGOG_LEVEL_TYPE level=LOGOG_LEVEL_ALL, const LOGOG_CHAR *sFileName=NULL, const int nLineNumber=0, const LOGOG_CHAR *sGroup=NULL, const LOGOG_CHAR *sCategory=NULL, const LOGOG_CHAR *sMessage=NULL, const double dTimestamp=0.0f) | |
virtual int | Send (const Topic &node) |
virtual int | Transmit () |
virtual bool | CanSubscribeTo (const Node &otherNode) |
virtual bool | CanSubscribeCheckTopic (const Topic &other) |
virtual void | Format (const LOGOG_CHAR *cFormatMessage,...) |
const LOGOG_STRING & | FileName () const |
void | FileName (const LOGOG_STRING &s) |
const LOGOG_STRING & | Message () const |
void | Message (const LOGOG_STRING &s) |
const LOGOG_STRING & | Category () const |
void | Category (const LOGOG_STRING &s) |
const LOGOG_STRING & | Group () const |
void | Group (const LOGOG_STRING &s) |
int | LineNumber () const |
void | LineNumber (const int num) |
LOGOG_LEVEL_TYPE | Level () const |
void | Level (LOGOG_LEVEL_TYPE level) |
LOGOG_TIME | Timestamp () const |
void | Timestamp (const LOGOG_TIME t) |
TOPIC_FLAGS | GetTopicFlags () const |
![]() | |
Node () | |
~Node () | |
virtual bool | CanSubscribe () const |
virtual bool | PublishToMultiple (LockableNodesType &nodes) |
virtual bool | UnpublishToMultiple (LockableNodesType &nodes) |
virtual bool | SubscribeTo (Node &publisher) |
virtual bool | SubscribeToMultiple (LockableNodesType &nodes) |
virtual bool | UnsubscribeTo (Node &publisher) |
virtual bool | UnsubscribeToMultiple (LockableNodesType &nodes) |
void | Clear () |
![]() | |
Object () | |
virtual | ~Object () |
void * | operator new (size_t nSize) |
void * | operator new[] (size_t nSize) |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
Public Attributes | |
bool | m_bWriteUnicodeBOM |
![]() | |
void * | m_pUserData1 |
void * | m_pUserData2 |
Protected Member Functions | |
virtual int | InternalOutput (size_t nSize, const LOGOG_CHAR *pData) |
Protected Attributes | |
char * | m_pFileName |
bool | m_bFirstTime |
bool | m_bOpenFailed |
FILE * | m_pFile |
bool | m_bEnableOutputBuffering |
![]() | |
Formatter * | m_pFormatter |
Mutex | m_MutexReceive |
bool | m_bNullTerminatesStrings |
![]() | |
LOGOG_STRING | m_vStringProps [TOPIC_STRING_COUNT] |
int | m_vIntProps [TOPIC_INT_COUNT] |
LOGOG_TIME | m_tTime |
TOPIC_FLAGS | m_TopicFlags |
![]() | |
LockableNodesType | m_Subscribers |
LockableNodesType | m_Publishers |
Additional Inherited Members | |
![]() | |
static void * | Allocate (size_t nSize) |
static void | Deallocate (void *ptr) |
A LogFile renders received messages to a file. Provide the name of the file to be rendered to as a parameter to the construction of the LogFile() object. Destroying a LogFile object will cause the output file to be closed. LogFile objects always append to the output file; they do not delete the previous log file.
LogFile | ( | const char * | sFileName, |
bool | bEnableOutputBuffering = true |
||
) |
Creates a LogFile object.
sFileName | The name of the file to be created. Since file names do not support Unicode on most systems, there is no option to create a filename with a LOGOG_CHAR. |
bEnableOutputBuffering | Whether to perform output buffering, or flush after each write. |
|
virtual |
Closes the log file.
|
protectedvirtual |
Does the actual fwrite to the file. Call Output() instead to handle error conditions better.
|
virtual |
Opens the log file on first write.
|
virtual |
Writes the message to the log file.
Implements Target.
|
virtual |
This function makes a guess as to the correct BOM for this file, and attempts to write it into the file. It does this by considering the size of LOGOG_CHAR as well as considering the current endianness of this system. This guess may be incorrect.
|
protected |
|
protected |
|
protected |
bool m_bWriteUnicodeBOM |
Should a Unicode BOM be written to the beginning of this log file, if the log file was previously empty? By default a BOM is written to a log file if LOGOG_UNICODE is enabled.
|
protected |
|
protected |