logog
logger optimized for games
|
#include <formatter.hpp>
Public Member Functions | |
Formatter () | |
virtual LOGOG_STRING & | Format (const Topic &topic, const Target &target)=0 |
virtual void | RenderTimeOfDay () |
virtual TOPIC_FLAGS | GetTopicFlags (const Topic &topic) |
bool | GetShowTimeOfDay () const |
void | SetShowTimeOfDay (bool val) |
Public Member Functions inherited from Object | |
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) |
Protected Member Functions | |
const LOGOG_CHAR * | ErrorDescription (const LOGOG_LEVEL_TYPE level) |
Protected Attributes | |
LOGOG_STRING | m_sMessageBuffer |
LOGOG_STRING | m_sIntBuffer |
bool | m_bShowTimeOfDay |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
static void * | Allocate (size_t nSize) |
static void | Deallocate (void *ptr) |
Converts a topic into a human-readable string for printing or otherwise rendering to a target.
Formatter | ( | ) |
|
protected |
|
pure virtual |
Causes this formatter to format a topic into its own m_sMessageBuffer field, and thence to return a reference to that string. This function must be written to be efficient; it will be called for every logging operation. It is strongly recommended not to allocate or free memory in this function.
Implemented in FormatterMSVC, and FormatterGCC.
bool GetShowTimeOfDay | ( | ) | const |
Should this formatter render the current time of day?
|
virtual |
In the base case, this function calls GetTopicFlags() on the provided topic in order to figure out which fields this formatter should render. However, subclasses of the Formatter class can override this function in order to change the default fields that the topic wants to be rendered. For example, you can turn off the TOPIC_LINE_NUMBER_FLAG and the TOPIC_FILE_NAME_FLAG in order to disable these fields from being rendered in your own Formatter subclass.
topic | The topic whose flags are to be determined |
|
virtual |
Causes the time of day to be rendered, if it needs to be rendered. This function is only supported on ANSI builds, not Unicode, as the underlying functions are ANSI only.
void SetShowTimeOfDay | ( | bool | val | ) |
Sets whether this formatter renders the current time of day. Time of day is not rendered by default. This function is only supported on ANSI builds, not Unicode, as the underlying functions are ANSI only.
|
protected |
|
protected |
|
protected |