[#BloombergLP-balst-StackTracePrintUtil-logExceptionStackTrace]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balst.adoc[balst]::xref:BloombergLP/balst/StackTracePrintUtil.adoc[StackTracePrintUtil]::logExceptionStackTrace
:relfileprefix: ../../../
:mrdocs:

Log an exception name, message, and stack trace via `BSLS&lowbar;LOG`&period;

== Synopsis

Declared in `&lt;balst&lowbar;stacktraceprintutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
logExceptionStackTrace(
    char const* exceptionName,
    char const* message);
----

== Description

Log a message using `BSLS&lowbar;LOG` consisting of &quot;About to throw &lt;exceptionName&gt;&period; &lt;message&gt;&quot; followed by a stack trace&period; This function is to be set as an exception &quot;pre throw hook&quot; for the component `bslstl&lowbar;stdexceptutil`&period; If this function is set as the pre throw hook, it will be called prior to exceptions being thrown&period; Note that this function requires considerable disk access and is therefore slow, so it should not be used for frequently&hyphen;occurring exceptions that are expected to be caught and recovered from&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *exceptionName*
| name of the exception about to be thrown
| *message*
| explanatory message associated with the exception
|===


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