[#BloombergLP-ball-Logger-obtainMessageBuffer-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/Logger.adoc[Logger]::obtainMessageBuffer
:relfileprefix: ../../../
:mrdocs:

Block until access to the buffer of this logger used for formatting messages is available&period; Return the address of the modifiable buffer to which this thread of execution has exclusive access, load the address of the mutex that protects the buffer into the specified `&ast;mutex` address, and load the size (in bytes) of the buffer into the specified `bufferSize` address&period; The address remains valid, and the buffer remains locked by this thread of execution, until this thread calls `mutex&hyphen;&gt;unlock()`&period; The behavior is undefined if this thread of execution currently holds a lock on the buffer&period; Note that the buffer is intended to be used _only_ for formatting log messages immediately before calling `logMessage`&semi; other use may adversely affect performance for the entire program&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
char*
obtainMessageBuffer(
    xref:BloombergLP/bslmt/Mutex.adoc[bslmt::Mutex]** mutex,
    int* bufferSize);
----


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