[#BloombergLP-ball-StreamObserver]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::StreamObserver
:relfileprefix: ../../
:mrdocs:

This class provides a concrete implementation of the `Observer` protocol&period;

== Synopsis

Declared in `&lt;ball&lowbar;streamobserver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class StreamObserver
    : public xref:BloombergLP/ball/Observer.adoc[Observer]
----

== Description

The `publish` method of this class outputs the log records that it receives to an instance of `bsl&colon;&colon;ostream` supplied at construction&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/ball/Observer.adoc[Observer]`
| This class provides a protocol for receiving and processing log record output&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/StreamObserver/RecordFormatFunctor.adoc[`RecordFormatFunctor`] 
| Alias for the record formatting functor type&period;
| xref:BloombergLP/ball/StreamObserver/RecordFormatter.adoc[`RecordFormatter`] 
| `LogRecordFunctor` is an alias for the type of the functor used for formatting log records to a stream&period;
| xref:BloombergLP/ball/StreamObserver/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias for the allocator used by this object&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/StreamObserver/2constructor.adoc[`StreamObserver`]         [.small]#[constructor]#
| Create a stream observer that transmits log records to `stream`&period;
| xref:BloombergLP/ball/StreamObserver/2destructor.adoc[`&#126;StreamObserver`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this stream observer&period;
| xref:BloombergLP/ball/StreamObserver/disablePublishInLocalTime.adoc[`disablePublishInLocalTime`] 
| Disable publishing of record timestamps in local time&period;
| xref:BloombergLP/ball/StreamObserver/enablePublishInLocalTime.adoc[`enablePublishInLocalTime`] 
| Enable publishing of record timestamps in local time&period;
| xref:BloombergLP/ball/StreamObserver/getFormat.adoc[`getFormat`] 
| Return the format config of the last successful `setFormat` call&period;
| xref:BloombergLP/ball/StreamObserver/isPublishInLocalTimeEnabled.adoc[`isPublishInLocalTimeEnabled`] 
| Return `true` if published timestamps are written in local time&period;
| xref:BloombergLP/ball/StreamObserver/publish-03.adoc[`publish`] 
| `publish` overloads
| xref:BloombergLP/ball/StreamObserver/releaseRecords.adoc[`releaseRecords`]  [.small]#[virtual]#
| Discard any shared reference to a `Record` object held by this observer&period;
| xref:BloombergLP/ball/StreamObserver/setFormat.adoc[`setFormat`] 
| Set the stream record format from the specified `format` string&period;
| xref:BloombergLP/ball/StreamObserver/setRecordFormatFunctor.adoc[`setRecordFormatFunctor`] 
| Set the formatting functor used when writing records to the stream&period;
|===


== Using Declarations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/StreamObserver/publish-0dd.adoc[`publish`] 
| Import the base&hyphen;class `publish` overloads&period;
|===



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