[#BloombergLP-bslstl-StdExceptUtil-logCheapStackTrace]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StdExceptUtil.adoc[StdExceptUtil]::logCheapStackTrace
:relfileprefix: ../../../
:mrdocs:

Log a warning with a cheap stack trace before an exception is thrown&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stdexceptutil&period;h&gt;`

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

== Description

Log &quot;About to throw &quot;, then the specified `exceptionName`, then the specified `message`, then log a cheap stack trace with warning severity&period; This function is intended as a candidate for setting to the pre&hyphen;throw hooks&period; Note that a far slower alternative to this, which logs a full, multi&hyphen;line stack trace with resolved symbols and, on many platforms, line numbers and source file names, is `balst&colon;&colon;StackTracePrintUtil&colon;&colon;logExceptionStackTrace`&period;

== Parameters

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


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