[#BloombergLP-bsls-Log]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::Log
:relfileprefix: ../../
:mrdocs:

This class serves as a namespace containing a suite of utility functions that allow low&hyphen;level code to write log messages to a configurable, globally controlled destination&period;

== Synopsis

Declared in `&lt;bsls&lowbar;log&period;h&gt;`

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

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/Log/LogMessageHandler-05.adoc[`LogMessageHandler`] 
| The `LogMessageHandler` `typedef` represents a type of function that handles log messages in an unspecified way (e&period;g&period;, by writing the log message to an output stream or to a file)&period; Because they can be called concurrently from multiple threads, log message handlers must be thread&hyphen;safe&period; While installed, handlers must exhibit only defined behavior if the specified `file` is a null&hyphen;terminated string, the specified `line` is not negative, and the specified `message` is a null&hyphen;terminated string&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/Log/logFormattedMessage.adoc[`logFormattedMessage`] 
| If the specified `severity` is at least as severe as `severityThrehold`, invoke the currently installed log message handler with `severity` and the specified `file` and `line`, as well as a message string created by calling `sprintf` on the specified `format` with the specified variadic arguments&semi; otherwise (if `severity` is less severe), this operation has no effect&period; The behavior is undefined unless `0 &lt;&equals; line`, and `format` is a valid `sprintf` format specification for the supplied variadic arguments&period;
| xref:BloombergLP/bsls/Log/logMessage.adoc[`logMessage`] 
| If the specified `severity` is at least as severe as `severityThreshold`, invoke the currently installed log message handler with `severity`, as well as the specified `file`, `line`, and `message`&semi; otherwise (if `severity` is less severe), this operation has no effect&period; The behavior is undefined unless `0 &lt;&equals; line`&period;
| xref:BloombergLP/bsls/Log/logMessageHandler-08.adoc[`logMessageHandler`] 
| Return the address of the currently installed log message handler&period;
| xref:BloombergLP/bsls/Log/platformDefaultMessageHandler.adoc[`platformDefaultMessageHandler`] 
| Write, to a platform&hyphen;specific destination, a string composed of the specified `severity`, `file` name, `line` number, and `message`&period; On _non_&hyphen;Windows systems, write the log record to the `stderr` output stream&period; On _Windows_ systems&colon; If the current process is running in _console_ _mode_, write the log record to the `stderr` output stream&period; If the current process is running in _non&hyphen;console_ _mode_, write the log record to the Windows process debugger&period; The behavior is undefined unless `0 &lt;&equals; line`&period; Note that this function is used as the default log message handler&period; Also note that this function will write the message irrespective of the current `severityThreshold`&period;
| xref:BloombergLP/bsls/Log/setLogMessageHandler.adoc[`setLogMessageHandler`] 
| Install the specified `handler` as the current log message handler&period;
| xref:BloombergLP/bsls/Log/setSeverityThreshold.adoc[`setSeverityThreshold`] 
| Set the severity threshold at which log records are written by `logMessage` and `logFormattedMessage` to the specified `severity`&period;
| xref:BloombergLP/bsls/Log/severityThreshold.adoc[`severityThreshold`] 
| Return the currently configured severity threshold at or above which records are written by `logMessage` and `logFormattedMessage`&period;
| xref:BloombergLP/bsls/Log/stderrMessageHandler.adoc[`stderrMessageHandler`] 
| Write, to the `stderr` output stream, a string composed of the specified `severity`, `file` name, `line` number, and the `message`&period; The behavior is undefined unless `0 &lt;&equals; line`&period; Note that this function provides an implementation of the `LogMessageHandler` function prototype, and will write the message irrespective of the current `severityThreshold`&period;
| xref:BloombergLP/bsls/Log/stdoutMessageHandler.adoc[`stdoutMessageHandler`] 
| Write, to the `stdout` output stream, a string composed of the specified `severity`, `file` name, `line` number, and the `message`&period; The behavior is undefined unless `0 &lt;&equals; line`&period; Note that this function provides an implementation of the `LogMessageHandler` function prototype, and will write the message irrespective of the current `severityThreshold`&period;
|===



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