BloombergLP::ball::ObserverFormatterImp

Provide shared formatting support for scheme-based log observers.

Synopsis

Declared in <ball_observerformatterimp.h>

class ObserverFormatterImp;

Description

This class provides a common implementation of formatting-related methods for observer components that support scheme-based log record formatting. It manages a log record formatter, format configuration strings, and time zone preferences. This implementation is intended to be used as a data member in concrete observer classes to provide consistent formatting behavior across different observer types.

Type Aliases

NameDescription
RecordFormatter RecordFormatter is an alias for the type of the functor used for formatting log records to a stream.
allocator_type This typedef is an alias for the allocator used by this object.

Member Functions

NameDescription
ObserverFormatterImp [constructor]Create a ObserverFormatterImp instance that formats log records using the specified format and timezoneDefault.
formatLogRecord Format the specified log record into the specified output stream using the current record formatter functor.
getFormat Return the currently active format configuration string of this object.
getTimezoneDefault Return the currently active time zone default of this object.
get_allocator Return the allocator used by this object to supply memory.
setFormat Set the log record format specifications for this object according to the specified format.
setFormatFunctor Set the formatting functor used when writing records to the specified formatter functor.
setTimezoneDefault Set the default time zone used for timestamps that have no timezone preference specified in the format config string.