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

This class provides log record management services&period; Each instance of `Logger` receives log records from one or more clients, manages the storage of those records, and transmits them to a registered recipient (i&period;e&period;, an observer) when appropriate&period;

== Synopsis

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

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

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/Logger/PublishAllTriggerCallback.adoc[`PublishAllTriggerCallback`] 
| `PublishAllTriggerCallback` is the type of the functor that is invoked with the publication cause to publish all record buffers of all loggers that are allocated by the logger manager&period;
| xref:BloombergLP/ball/Logger/UserFieldsPopulatorCallback.adoc[`UserFieldsPopulatorCallback`] 
| `UserFieldsPopulatorCallback` is the type of a user&hyphen;supplied callback functor used to populate the user&hyphen;defined fields in each log record&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/Logger/getRecord.adoc[`getRecord`] 
| Return the address of a modifiable record having the specified `fileName` and `lineNumber` attributes, and retrieved from the object pool managed by this logger&period; Note that the returned `Record` must subsequently be supplied to a call to the 3&hyphen;argument `logMessage` method on this logger&period;
| xref:BloombergLP/ball/Logger/logMessage-0b.adoc[`logMessage`] 
| `logMessage` overloads
| xref:BloombergLP/ball/Logger/messageBuffer.adoc[`messageBuffer`] 
| Return the address of the modifiable message buffer managed by this logger&period; Note that the returned buffer is intended to be used _only_ for formatting log messages immediately before calling `logMessage`&period;
| xref:BloombergLP/ball/Logger/messageBufferSize.adoc[`messageBufferSize`] 
| Return the size, in bytes, of the message buffer managed by this logger&period;
| xref:BloombergLP/ball/Logger/numRecordsInUse.adoc[`numRecordsInUse`] 
| Return a _snapshot_ of number of records that have been dispensed by `getRecord` but have not yet been supplied (returned) using `logRecord`&period;
| xref:BloombergLP/ball/Logger/obtainMessageBuffer-04.adoc[`obtainMessageBuffer`] 
| `obtainMessageBuffer` overloads
| xref:BloombergLP/ball/Logger/publish.adoc[`publish`] 
| Publish to the observer held by this logger all records stored in the record buffer of this logger and indicate to the observer that the cause is `MANUAL&lowbar;PUBLISH`&period;
| xref:BloombergLP/ball/Logger/removeAll.adoc[`removeAll`] 
| Remove all log records from the record buffer of this logger&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/ball/LoggerManager.adoc[BloombergLP::ball::LoggerManager]`
| This class is _usually_ a singleton&period; It provides a factory for `Logger` objects and is also a wrapper for category administration services&period; Note that some services provided by this class are available only after the singleton has been initialized&period;
|===


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