This class provides a concrete implementation of the Observer protocol.

Synopsis

Declared in <ball_streamobserver.h>

class StreamObserver
    : public 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

Name

Description

Observer

This class provides a protocol for receiving and processing log record output.

Type Aliases

Name

Description

RecordFormatFunctor

Alias for the record formatting functor type.

RecordFormatter

LogRecordFunctor is an alias for the type of the functor used for formatting log records to a stream.

allocator_type

This typedef is an alias for the allocator used by this object.

Member Functions

Name

Description

StreamObserver [constructor]

Create a stream observer that transmits log records to stream.

~StreamObserver [destructor] [virtual]

Destroy this stream observer.

disablePublishInLocalTime

Disable publishing of record timestamps in local time.

enablePublishInLocalTime

Enable publishing of record timestamps in local time.

getFormat

Return the format config of the last successful setFormat call.

isPublishInLocalTimeEnabled

Return true if published timestamps are written in local time.

publish

publish overloads

releaseRecords [virtual]

Discard any shared reference to a Record object held by this observer.

setFormat

Set the stream record format from the specified format string.

setRecordFormatFunctor

Set the formatting functor used when writing records to the stream.

Using Declarations

Name

Description

publish

Import the base‐class publish overloads.

Created with MrDocs