BloombergLP::ball::Logger

This class provides log record management services. Each instance of Logger receives log records from one or more clients, manages the storage of those records, and transmits them to a registered recipient (i.e., an observer) when appropriate.

Synopsis

Declared in <ball_loggermanager.h>

class Logger;

Type Aliases

NameDescription
PublishAllTriggerCallback PublishAllTriggerCallback is the type of the functor that is invoked with the publication cause to publish all record buffers of all loggers that are allocated by the logger manager.
UserFieldsPopulatorCallback UserFieldsPopulatorCallback is the type of a user-supplied callback functor used to populate the user-defined fields in each log record.

Member Functions

NameDescription
getRecord Return the address of a modifiable record having the specified fileName and lineNumber attributes, and retrieved from the object pool managed by this logger. Note that the returned Record must subsequently be supplied to a call to the 3-argument logMessage method on this logger.
logMessage logMessage overloads
messageBuffer Return the address of the modifiable message buffer managed by this logger. Note that the returned buffer is intended to be used only for formatting log messages immediately before calling logMessage.
messageBufferSize Return the size, in bytes, of the message buffer managed by this logger.
numRecordsInUse Return a snapshot of number of records that have been dispensed by getRecord but have not yet been supplied (returned) using logRecord.
obtainMessageBuffer obtainMessageBuffer overloads
publish Publish to the observer held by this logger all records stored in the record buffer of this logger and indicate to the observer that the cause is MANUAL_PUBLISH.
removeAll Remove all log records from the record buffer of this logger.

Friends

NameDescription
BloombergLP::ball::LoggerManagerThis class is usually a singleton. It provides a factory for Logger objects and is also a wrapper for category administration services. Note that some services provided by this class are available only after the singleton has been initialized.