[#BloombergLP-bsls-OutputRedirector-enable]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/OutputRedirector.adoc[OutputRedirector]::enable
:relfileprefix: ../../../
:mrdocs:

Redirect the configured stream to a temporary file&period;

== Synopsis

Declared in `&lt;bsls&lowbar;outputredirector&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
enable();
----

== Description

If the `Stream` specified at construction was `e&lowbar;STDOUT&lowbar;STREAM`, redirect `stdout` to a temporary file&period; If the `Stream` specified at construction was `e&lowbar;STDERR&lowbar;STREAM`, redirect `stderr` to a temporary file&period; The temporary file to which the stream is redirected will be created the first time `enable` is called, and will be deleted when this object is destroyed&period; If `enable` fails to redirect either `stdout` or `stderr` it will end the program by calling `std&colon;&colon;abort`&period;


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