[#BloombergLP-ball-Logger] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::Logger :relfileprefix: ../../ :mrdocs: This class provides log record management services. 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.e., an observer) when appropriate. == Synopsis Declared in `<ball_loggermanager.h>` [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. | xref:BloombergLP/ball/Logger/UserFieldsPopulatorCallback.adoc[`UserFieldsPopulatorCallback`] | `UserFieldsPopulatorCallback` is the type of a user‐supplied callback functor used to populate the user‐defined fields in each log record. |=== == 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. Note that the returned `Record` must subsequently be supplied to a call to the 3‐argument `logMessage` method on this logger. | 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. Note that the returned buffer is intended to be used _only_ for formatting log messages immediately before calling `logMessage`. | xref:BloombergLP/ball/Logger/messageBufferSize.adoc[`messageBufferSize`] | Return the size, in bytes, of the message buffer managed by this logger. | 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`. | 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_PUBLISH`. | xref:BloombergLP/ball/Logger/removeAll.adoc[`removeAll`] | Remove all log records from the record buffer of this logger. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/ball/LoggerManager.adoc[BloombergLP::ball::LoggerManager]` | This class is _usually_ a singleton. It provides a factory for `Logger` objects and is also a wrapper for category administration services. Note that some services provided by this class are available only after the singleton has been initialized. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#