[#BloombergLP-ball-RecordStringFormatter] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::RecordStringFormatter :relfileprefix: ../../ :mrdocs: This class provides a value‐semantic log record formatter that holds a `printf`‐style format specification and a timestamp offset. The overloaded `operator()` provided by the class formats a given record according to the format specification and outputs the formatted result to a given stream. The timestamp offset of the record formatter is added to each timestamp that is output to the stream. == Synopsis Declared in `<ball_recordstringformatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class RecordStringFormatter; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/RecordStringFormatter/allocator_type.adoc[`allocator_type`] | This `typedef` is an alias for the allocator used by this object. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/RecordStringFormatter/2constructor-0e5.adoc[`RecordStringFormatter`] [.small]#[constructor]# | Constructors | xref:BloombergLP/ball/RecordStringFormatter/operator_assign.adoc[`operator=`] | Assign to this record formatter the value of the specified `rhs` record formatter. | xref:BloombergLP/ball/RecordStringFormatter/disablePublishInLocalTime.adoc[`disablePublishInLocalTime`] | Disable adjust of the timestamp attribute of to the current local time by this file observer. This method has no effect if adjustment to the current local time is not enabled. | xref:BloombergLP/ball/RecordStringFormatter/enablePublishInLocalTime.adoc[`enablePublishInLocalTime`] | Enable adjustment of the timestamp attribute to the current local time. This method has no effect if adjustment to the current local time is already enabled. | xref:BloombergLP/ball/RecordStringFormatter/format.adoc[`format`] | Return the format specification of this record formatter. | xref:BloombergLP/ball/RecordStringFormatter/get_allocator.adoc[`get_allocator`] | Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used. | xref:BloombergLP/ball/RecordStringFormatter/isPublishInLocalTimeEnabled.adoc[`isPublishInLocalTimeEnabled`] | Return `true` if this formatter adjusts the timestamp attribute to the current local time, and `false` otherwise. | xref:BloombergLP/ball/RecordStringFormatter/operator_call.adoc[`operator()`] | Format the specified `record` according to the format specification of this record formatter and output the result to the specified `stream`. The timestamp offset of this record formatter is added to each timestamp that is output to `stream`. | xref:BloombergLP/ball/RecordStringFormatter/setFormat.adoc[`setFormat`] | Set the format specification of this record formatter to the specified `format`. | xref:BloombergLP/ball/RecordStringFormatter/setTimestampOffset.adoc[`setTimestampOffset`] | Set the timestamp offset of this record formatter to the specified `offset`. | xref:BloombergLP/ball/RecordStringFormatter/timestampOffset.adoc[`timestampOffset`] | Return a reference to the non‐modifiable timestamp offset of this record formatter. | xref:BloombergLP/ball/RecordStringFormatter/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<RecordStringFormatter, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/RecordStringFormatter/loadTextSchemeFormatter.adoc[`loadTextSchemeFormatter`] | This class method configures a formatter for the "text" scheme using the specified `format` and `formatOptions` and if successful loads it into the specified `output` and returns zero. In case configuration fails a non‐zero value is returned and `output` is loaded with a string formatter of the default format configuration ` "n%d %p:%t %s %f:%l %c %m %un" ` |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/RecordStringFormatter/k_BASIC_ATTRIBUTE_FORMAT.adoc[`k_BASIC_ATTRIBUTE_FORMAT`] | A simple standard record format that renders `ball::Attribute` values in the formatted output. Note that this format is recommended over the default format, `k_DEFAULT_FORMAT`, for most applications (the default format is currently maintained for backwards compatibility). | xref:BloombergLP/ball/RecordStringFormatter/k_DEFAULT_FORMAT.adoc[`k_DEFAULT_FORMAT`] | The default log format specification used by `RecordStringFormatter`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/operator_not_eq-065.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` record formatters do not have the same value, and `false` otherwise. Two record formatters differ in value if their format specifications differ or their timestamp offsets differ. | xref:BloombergLP/ball/operator_eq-00d.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` record formatters have the same value, and `false` otherwise. Two record formatters have the same value if they have the same format specification and the same timestamp offset. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#