BloombergLP::ball::Log

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>

struct Log;

Static Member Functions

NameDescription
categoryHolderIfEnabled Return the specified categoryHolder if the severity warrants logging according to the specified t_SEVERITY and categoryHolder, and 0 otherwise.
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.
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.
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.
logMessage logMessage overloads
obtainMessageBuffer obtainMessageBuffer overloads
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.
setCategory setCategory overloads
setCategoryHierarchically setCategoryHierarchically overloads