[#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. == Synopsis Declared in `<ball_streamobserver.h>` [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::ostream` supplied at construction. == 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. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/StreamObserver/RecordFormatFunctor.adoc[`RecordFormatFunctor`] | Alias for the record formatting functor type. | 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. | xref:BloombergLP/ball/StreamObserver/allocator_type.adoc[`allocator_type`] | This `typedef` is an alias for the allocator used by this object. |=== == 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`. | xref:BloombergLP/ball/StreamObserver/2destructor.adoc[`~StreamObserver`] [.small]#[destructor]# [.small]#[virtual]# | Destroy this stream observer. | xref:BloombergLP/ball/StreamObserver/disablePublishInLocalTime.adoc[`disablePublishInLocalTime`] | Disable publishing of record timestamps in local time. | xref:BloombergLP/ball/StreamObserver/enablePublishInLocalTime.adoc[`enablePublishInLocalTime`] | Enable publishing of record timestamps in local time. | xref:BloombergLP/ball/StreamObserver/getFormat.adoc[`getFormat`] | Return the format config of the last successful `setFormat` call. | xref:BloombergLP/ball/StreamObserver/isPublishInLocalTimeEnabled.adoc[`isPublishInLocalTimeEnabled`] | Return `true` if published timestamps are written in local time. | 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. | xref:BloombergLP/ball/StreamObserver/setFormat.adoc[`setFormat`] | Set the stream record format from the specified `format` string. | xref:BloombergLP/ball/StreamObserver/setRecordFormatFunctor.adoc[`setRecordFormatFunctor`] | Set the formatting functor used when writing records to the stream. |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/ball/StreamObserver/publish-0dd.adoc[`publish`] | Import the base‐class `publish` overloads. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#