|
BDE 4.39.x Production Release
|
Enumerate a set of timezone defaults for log timestamps.
Enumerate a set of timezone defaults for log timestamps.
This component provides a namespace, ball::RecordFormatterTimezone, for the enum type ball::RecordFormatterTimezone::Enum. Enum enumerates a list of time stamp timezone values that log record formatters may apply.
This section illustrates intended use of this component.
Suppose we are implementing a logging system and need to allow users to configure whether timestamps should be rendered in UTC or local time. We can use ball::RecordFormatterTimezone::Enum to represent this choice.
First, we define a variable to hold the configured timezone setting, defaulting to UTC:
Then, based on user configuration, we might change this to local time:
Finally, we can use this value to control timestamp formatting:
This allows timestamps in log records to be rendered in either UTC (useful for distributed systems and log aggregation) or local time (useful for local debugging and human readability).