[#absl-LogStreamer]
= xref:absl.adoc[absl]::LogStreamer
:relfileprefix: ../
:mrdocs:

Although you can stream into `LOG(INFO)`, you can&apos;t pass it into a function that takes a `std&colon;&colon;ostream` parameter&period; `LogStreamer&colon;&colon;stream()` provides a `std&colon;&colon;ostream` that buffers everything that&apos;s streamed in&period; The buffer&apos;s contents are logged as if by `LOG` when the `LogStreamer` is destroyed&period; If nothing is streamed in, an empty message is logged&period; If the specified severity is `absl&colon;&colon;LogSeverity&colon;&colon;kFatal`, the program will be terminated when the `LogStreamer` is destroyed regardless of whether any data were streamed in&period;

== Synopsis

Declared in `&lt;absl&sol;log&sol;log&lowbar;streamer&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class LogStreamer final
----

== Description

Factory functions corresponding to the `absl&colon;&colon;LogSeverity` enumerators are provided for convenience&semi; if the desired severity is variable, invoke the constructor directly&period;

LogStreamer is movable, but not copyable&period;

Examples&colon;

ShaveYakAndWriteToStream( yak, absl&colon;&colon;LogInfoStreamer(*FILE*, *LINE*)&period;stream())&semi;

&lcub; &sol;&sol; This logs a single line containing data streamed by all three function &sol;&sol; calls&period; absl&colon;&colon;LogStreamer streamer(absl&colon;&colon;LogSeverity&colon;&colon;kInfo, *FILE*, *LINE*)&semi; ShaveYakAndWriteToStream(yak1, streamer&period;stream())&semi; streamer&period;stream() &lt;&lt; &quot; &quot;&semi; ShaveYakAndWriteToStream(yak2, streamer&period;stream())&semi; streamer&period;stream() &lt;&lt; &quot; &quot;&semi; ShaveYakAndWriteToStreamPointer(yak3, &amp;streamer&period;stream())&semi; &rcub;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/LogStreamer/2constructor-029.adoc[`LogStreamer`]         [.small]#[constructor]#
| Constructors
| xref:absl/LogStreamer/2destructor.adoc[`&#126;LogStreamer`] [.small]#[destructor]#
| Logs this LogStreamer&apos;s buffered content as if by LOG&period;
| xref:absl/LogStreamer/operator_assign.adoc[`operator&equals;`] 
| Logs this LogStreamer&apos;s current buffered content, then moves the state of `that` into this `LogStreamer`&period;
| xref:absl/LogStreamer/stream.adoc[`stream`] 
| Returns the `std&colon;&colon;ostream` to use to write into this LogStreamer&apos;s internal buffer&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/LogDebugFatalStreamer-01.adoc[`LogDebugFatalStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kLogDebugFatal&period;
| xref:absl/LogDebugFatalStreamer-0f.adoc[`LogDebugFatalStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kLogDebugFatal&period;
| xref:absl/LogErrorStreamer-02.adoc[`LogErrorStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kError&period;
| xref:absl/LogErrorStreamer-08.adoc[`LogErrorStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kError&period;
| xref:absl/LogFatalStreamer-06.adoc[`LogFatalStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kFatal&period;
| xref:absl/LogFatalStreamer-09.adoc[`LogFatalStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kFatal&period;
| xref:absl/LogInfoStreamer-04.adoc[`LogInfoStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kInfo&period;
| xref:absl/LogInfoStreamer-05.adoc[`LogInfoStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kInfo&period;
| xref:absl/LogWarningStreamer-07.adoc[`LogWarningStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kWarning&period;
| xref:absl/LogWarningStreamer-0c.adoc[`LogWarningStreamer`]
| Returns a LogStreamer that writes at level LogSeverity&colon;&colon;kWarning&period;
|===


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