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

Log and dispose of the specified record under category and severity&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
logMessage(
    xref:BloombergLP/ball/Category.adoc[Category] const& category,
    int severity,
    xref:BloombergLP/ball/Record.adoc[Record]* record);
----

== Description

Log the specified `&ast;record` after setting its category attribute to the name of the specified `category` and severity attribute to the specified `severity`&period; (See the component&hyphen;level documentation of `ball&lowbar;record` for more information on the fields that are logged&period;) Store the record in the buffer held by this logger if `severity` is at least as severe as the current &quot;Record&quot; threshold level of `category`&period; Pass the record directly to the observer held by this logger if `severity` is at least as severe as the current &quot;Pass&quot; threshold level of `category`&period; Publish the entire contents of the buffer of this logger if `severity` is at least as severe as the current &quot;Trigger&quot; threshold level of `category`&period; Publish the entire contents of all buffers of all active loggers if `severity` is at least as severe as the current &quot;Trigger&hyphen;All&quot; threshold level of `category` (i&period;e&period;, via the callback supplied at construction)&period; Finally, dispose of `record`&period; This method has no effect (other than disposing of `record`) if `severity` is less severe than each of the threshold levels of `category`&period; The behavior is undefined unless `severity` is in the range `&lsqb;1 &period;&period; 255&rsqb;`, both `fileName` and `message` are null&hyphen;terminated, and `record` was previously obtained by a call to `getRecord` on this logger&period; Note that `record` will be invalid after this method returns&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *category*
| category under which the record is logged
| *severity*
| severity level assigned to the record
| *record*
| record to log and then dispose of
|===


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