BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball::Log_Formatter Class Reference

#include <ball_log.h>

Public Member Functions

 Log_Formatter (const Category *category, const char *fileName, int lineNumber, int severity)
 
 ~Log_Formatter ()
 
char * messageBuffer ()
 
Recordrecord ()
 
const Categorycategory () const
 
int messageBufferLen () const
 
const Recordrecord () const
 
int severity () const
 Return the severity held by this logging formatter.
 

Detailed Description

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
Record * record()
Definition ball_log.h:1948
const Category * category() const
Definition ball_log.h:1955
int severity() const
Return the severity held by this logging formatter.
Definition ball_log.h:1973

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.

See ball_log

Constructor & Destructor Documentation

◆ Log_Formatter()

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.

◆ ~Log_Formatter()

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.

Member Function Documentation

◆ category()

const Category * ball::Log_Formatter::category ( ) const
inline

Return the address of the non-modifiable category held by this logging formatter.

◆ messageBuffer()

char * ball::Log_Formatter::messageBuffer ( )
inline

Return the address of the modifiable buffer held by this logging formatter. The address remains valid until this logging formatter is destroyed.

◆ messageBufferLen()

int ball::Log_Formatter::messageBufferLen ( ) const
inline

Return the length (in bytes) of the buffer held by this logging formatter.

◆ record() [1/2]

Record * ball::Log_Formatter::record ( )
inline

Return the address of the modifiable log record held by this logging formatter. The address remains valid until this logging formatter is destroyed.

◆ record() [2/2]

const Record * ball::Log_Formatter::record ( ) const
inline

Return the address of the non-modifiable log record held by this logging formatter. The address remains valid until this logging formatter is destroyed.

◆ severity()

int ball::Log_Formatter::severity ( ) const
inline

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