BloombergLP::ball::RecordStringFormatter::RecordStringFormatter

Create a record formatter with the specified format and local-time flag.

Synopsis

Declared in <ball_recordstringformatter.h>

RecordStringFormatter(
    char const* format,
    bool publishInLocalTime,
    allocator_type const& allocator = allocator_type());

Description

If the specified publishInLocalTime flag is true, format the timestamp of each log in the local time of the current task, and format the timestamp in UTC otherwise. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used. Note that local time offsets are calculated for the timestamp of each formatted record and so track transitions into and out of Daylight Saving Time.

Parameters

NameDescription
formatprintf-style format specification
publishInLocalTimewhether to format timestamps in local time
allocatorallocator used to supply memory