[#BloombergLP-ball-Log] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::Log :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for a suite of utility functions that simplify usage of the `ball_loggermanager` component. The direct use of these utility functions is _strongly_ discouraged. == Synopsis Declared in `<ball_log.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct Log; ---- == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/Log/categoryHolderIfEnabled.adoc[`categoryHolderIfEnabled`] | Return the specified `categoryHolder` if the severity warrants logging according to the specified `t_SEVERITY` and `categoryHolder`, and 0 otherwise. | xref:BloombergLP/ball/Log/format.adoc[`format`] | Fill the specified `buffer` with at most the specified `numBytes` characters produced by formatting the variable argument list according to the specified `printf`‐style `format` argument; return the number of characters in the resulting formatted string. The last character placed into `buffer` is always a null terminator (leaving at most `numBytes ‐ 1` bytes of formatted data). If `numBytes` is insufficient for the entire formatted string, this method fills `buffer` with the initial `numBytes ‐ 1` bytes of formatted data followed by a null terminator and returns ‐1. Note that with the exception of the return value, the behavior of this function exactly matches that of the C99 function `snprintf`. Also note that `snprintf` is not part of standard C++‐98, so its functionality is provided here. | xref:BloombergLP/ball/Log/getRecord.adoc[`getRecord`] | Return the address of a modifiable record having the specified `fileName` and `lineNumber` attributes. The memory for the record will be supplied by the allocator held by the logger manager singleton if the specified `category` is non‐null, or by the currently installed default allocator otherwise. The behavior is undefined unless the logger manager singleton is initialized when `category` is non‐null. Note that the returned `Record` must subsequently be supplied to a call to the 3‐argument `logMessage` method. | xref:BloombergLP/ball/Log/isCategoryEnabled.adoc[`isCategoryEnabled`] | Return `true` if logging to the category associated with the specified `categoryHolder` at the specified `severity` is enabled, or if `Severity::e_WARN >= severity` and the logger manager singleton is not initialized; return `false` otherwise. | xref:BloombergLP/ball/Log/logMessage-02.adoc[`logMessage`] | `logMessage` overloads | xref:BloombergLP/ball/Log/obtainMessageBuffer-0c.adoc[`obtainMessageBuffer`] | `obtainMessageBuffer` overloads | xref:BloombergLP/ball/Log/releaseMessageBuffer.adoc[`releaseMessageBuffer`] | Unlock the specified `mutex` that guards the buffer used for formatting messages in this thread of execution. The behavior is undefined unless `mutex` was obtained by a call to `Log::obtainMessageBuffer` and has not yet been unlocked. | xref:BloombergLP/ball/Log/setCategory-0b.adoc[`setCategory`] | `setCategory` overloads | xref:BloombergLP/ball/Log/setCategoryHierarchically-0b.adoc[`setCategoryHierarchically`] | `setCategoryHierarchically` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#