BDE 4.39.x Production Release
Loading...
Searching...
No Matches
ball_recordformatteroptions

Detailed Description

Provides log record formatter option values.

Outline

Purpose

Provides log record formatter option values.

Classes

See also
ball_recordformatterregistryutil

Description

This component provides a value-semantic attribute class, RecordFormatterOptions, that represents the options that are in addition to the format string for configuring a log record formatter "plugin".

Usage

This section illustrates intended use of this component.

Example 1: Configuring Formatter Options

Suppose we are configuring a log record formatter and want to specify options for how timestamps should be rendered. We can use ball::RecordFormatterOptions to specify these configuration values.

First, we create a RecordFormatterOptions object with default settings, which uses UTC timezone:

Definition ball_recordformatteroptions.h:112
RecordFormatterTimezone::Enum timezoneDefault() const
Definition ball_recordformatteroptions.h:189
@ e_UTC
Definition ball_recordformattertimezone.h:115

Then, if we want to configure the formatter to use local time instead, we can either create the options object with the desired timezone:

localOptions.timezoneDefault());
@ e_LOCAL
Definition ball_recordformattertimezone.h:116

Or we can modify an existing options object:

assert(
void setTimezoneDefault(RecordFormatterTimezone::Enum timezoneDefault)
Definition ball_recordformatteroptions.h:180

Finally, we can pass these options to a formatter configuration function (such as ball::RecordJsonFormatter::loadJsonSchemeFormatter) to configure how timestamps are rendered in the log output.