[#BloombergLP-ball-RecordStringFormatter]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::RecordStringFormatter
:relfileprefix: ../../
:mrdocs:

This class provides a value&hyphen;semantic log record formatter that holds a `printf`&hyphen;style format specification and a timestamp offset&period; 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&period; The timestamp offset of the record formatter is added to each timestamp that is output to the stream&period;

== Synopsis

Declared in `&lt;ball&lowbar;recordstringformatter&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class RecordStringFormatter;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/RecordStringFormatter/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias for the allocator used by this object&period;
|===


== 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&equals;`] 
| Assign to this record formatter the value of the specified `rhs` record formatter&period;
| xref:BloombergLP/ball/RecordStringFormatter/disablePublishInLocalTime.adoc[`disablePublishInLocalTime`] 
| Disable adjust of the timestamp attribute of to the current local time by this file observer&period; This method has no effect if adjustment to the current local time is not enabled&period;
| xref:BloombergLP/ball/RecordStringFormatter/enablePublishInLocalTime.adoc[`enablePublishInLocalTime`] 
| Enable adjustment of the timestamp attribute to the current local time&period; This method has no effect if adjustment to the current local time is already enabled&period;
| xref:BloombergLP/ball/RecordStringFormatter/format.adoc[`format`] 
| Return the format specification of this record formatter&period;
| xref:BloombergLP/ball/RecordStringFormatter/get_allocator.adoc[`get&lowbar;allocator`] 
| Return the allocator used by this object to supply memory&period; Note that if no allocator was supplied at construction the default allocator in effect at construction is used&period;
| xref:BloombergLP/ball/RecordStringFormatter/isPublishInLocalTimeEnabled.adoc[`isPublishInLocalTimeEnabled`] 
| Return `true` if this formatter adjusts the timestamp attribute to the current local time, and `false` otherwise&period;
| 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`&period; The timestamp offset of this record formatter is added to each timestamp that is output to `stream`&period;
| xref:BloombergLP/ball/RecordStringFormatter/setFormat.adoc[`setFormat`] 
| Set the format specification of this record formatter to the specified `format`&period;
| xref:BloombergLP/ball/RecordStringFormatter/setTimestampOffset.adoc[`setTimestampOffset`] 
| Set the timestamp offset of this record formatter to the specified `offset`&period;
| xref:BloombergLP/ball/RecordStringFormatter/timestampOffset.adoc[`timestampOffset`] 
| Return a reference to the non&hyphen;modifiable timestamp offset of this record formatter&period;
| xref:BloombergLP/ball/RecordStringFormatter/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;RecordStringFormatter, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/RecordStringFormatter/loadTextSchemeFormatter.adoc[`loadTextSchemeFormatter`] 
| This class method configures a formatter for the &quot;text&quot; scheme using the specified `format` and `formatOptions` and if successful loads it into the specified `output` and returns zero&period; In case configuration fails a non&hyphen;zero value is returned and `output` is loaded with a string formatter of the default format configuration &grave; &quot;n%d %p&colon;%t %s %f&colon;%l %c %m %un&quot; &grave;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/RecordStringFormatter/k_BASIC_ATTRIBUTE_FORMAT.adoc[`k&lowbar;BASIC&lowbar;ATTRIBUTE&lowbar;FORMAT`] 
| A simple standard record format that renders `ball&colon;&colon;Attribute` values in the formatted output&period; Note that this format is recommended over the default format, `k&lowbar;DEFAULT&lowbar;FORMAT`, for most applications (the default format is currently maintained for backwards compatibility)&period;
| xref:BloombergLP/ball/RecordStringFormatter/k_DEFAULT_FORMAT.adoc[`k&lowbar;DEFAULT&lowbar;FORMAT`] 
| The default log format specification used by `RecordStringFormatter`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/operator_not_eq-065.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` record formatters do not have the same value, and `false` otherwise&period; Two record formatters differ in value if their format specifications differ or their timestamp offsets differ&period;
| xref:BloombergLP/ball/operator_eq-00d.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` record formatters have the same value, and `false` otherwise&period; Two record formatters have the same value if they have the same format specification and the same timestamp offset&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
