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

This `struct` serves as a namespace for static methods that perform and print a description of a stack trace&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct StackTracePrintUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balst/StackTracePrintUtil/logExceptionStackTrace.adoc[`logExceptionStackTrace`] 
| 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 funciton is set as the pre throw hook, it will be called prior to exceptions being thrown, 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;
| xref:BloombergLP/balst/StackTracePrintUtil/printStackTrace.adoc[`printStackTrace`] 
| Obtain a trace of the stack and print it to the specified `stream`&period; Optionally specify `maxFrames` indicating the maximum number of frames from the top of the stack that will be printed&period; If `maxFrames` is not specified, a value of at least 1024 is used&period; Optionally specify `demanglingPreferredFlag`, indicating a preference whether to attempt to demangle function names&period; If `damanglingPreferredFlag` is not specified, an attempt to demangle is assumed&period; If an error occurs, a single&hyphen;line error message is printed to `stream`&period; Optionally specify `additionalIgnoreFrames` which is added to `bsls&colon;&colon;StackAddressUtil&colon;&colon;k&lowbar;IGNORE&lowbar;FRAMES` to ignore frames of the caller&period; Return a reference to &apos;stream&period; The behavior is undefined unless `&hyphen;1 &lt;&equals; maxFrames` and `0 &lt;&equals; additionalIgnoreFrames`&period; Note that attempting to demangle symbol names could involve calling `malloc`, and that symbol names are always demangled on the Windows platform&period;
|===



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