Quick Links: |
#include <ball_log.h>
Public Member Functions | |
Log_Formatter (const Category *category, const char *fileName, int lineNumber, int severity) | |
~Log_Formatter () | |
char * | messageBuffer () |
Record * | record () |
const Category * | category () const |
int | messageBufferLen () const |
const Record * | record () const |
int | severity () const |
This class provides an aggregate of several objects relevant to the logging of a message via the printf
-style macros:
- record to be logged - category to which to log the record - severity at which to log the record - buffer in which the user log message is formatted
As a side-effect of creating an object of this class, the record is constructed, and the buffer is obtained. As a side-effect of destroying the object, the record is formatted, using the buffer, and logged.
This class should not be used directly by client code. It is an implementation detail of the macros provided by this component.
ball::Log_Formatter::Log_Formatter | ( | const Category * | category, | |
const char * | fileName, | |||
int | lineNumber, | |||
int | severity | |||
) |
Create a logging formatter that holds (1) the specified category
and severity
, (2) a record that is created from the specified fileName
and lineNumber
, and (3) a buffer into which the log message is formatted.
ball::Log_Formatter::~Log_Formatter | ( | ) |
Log the record held by this logging formatter to the held category (as returned by category
) at the held severity (as returned by severity
), and destroy this logging formatter.
char* ball::Log_Formatter::messageBuffer | ( | ) |
Return the address of the modifiable buffer held by this logging formatter. The address remains valid until this logging formatter is destroyed.
Record* ball::Log_Formatter::record | ( | ) |
Return the address of the modifiable log record held by this logging formatter. The address remains valid until this logging formatter is destroyed.
const Category* ball::Log_Formatter::category | ( | ) | const |
Return the address of the non-modifiable category held by this logging formatter.
int ball::Log_Formatter::messageBufferLen | ( | ) | const |
Return the length (in bytes) of the buffer held by this logging formatter.
const Record* ball::Log_Formatter::record | ( | ) | const |
Return the address of the non-modifiable log record held by this logging formatter. The address remains valid until this logging formatter is destroyed.
int ball::Log_Formatter::severity | ( | ) | const |
Return the severity held by this logging formatter.