xrpld
Loading...
Searching...
No Matches
beast::Journal::Stream Class Reference

Provide a light-weight way to check active() before string formatting. More...

#include <Journal.h>

Collaboration diagram for beast::Journal::Stream:

Public Member Functions

 Stream ()
 Create a stream which produces no output.
 Stream (Sink &sink, Severity level)
 Create a stream that writes at the given level.
 Stream (Stream const &other)
 Construct or copy another Stream.
Streamoperator= (Stream const &other)=delete
Sinksink () const
 Returns the Sink that this Stream writes to.
Severity level () const
 Returns the Severity level of messages this Stream reports.
template<typename T>
Journal::ScopedStream operator<< (T const &t) const
bool active () const
 Returns true if sink logs anything at this stream's level.
 operator bool () const
ScopedStream operator<< (std::ostream &manip(std::ostream &)) const
 Output stream support.
template<typename T>
ScopedStream operator<< (T const &t) const

Private Attributes

Sinksink_
Severity level_

Detailed Description

Provide a light-weight way to check active() before string formatting.

Definition at line 175 of file Journal.h.

Constructor & Destructor Documentation

◆ Stream() [1/3]

beast::Journal::Stream::Stream ( )
explicit

Create a stream which produces no output.

Definition at line 179 of file Journal.h.

◆ Stream() [2/3]

beast::Journal::Stream::Stream ( Sink & sink,
Severity level )

Create a stream that writes at the given level.

Constructor is inlined so checking active() very inexpensive.

Definition at line 187 of file Journal.h.

◆ Stream() [3/3]

beast::Journal::Stream::Stream ( Stream const & other)

Construct or copy another Stream.

Definition at line 194 of file Journal.h.

Member Function Documentation

◆ operator=()

Stream & beast::Journal::Stream::operator= ( Stream const & other)
delete

◆ sink()

Sink & beast::Journal::Stream::sink ( ) const
nodiscard

Returns the Sink that this Stream writes to.

Definition at line 203 of file Journal.h.

◆ level()

Severity beast::Journal::Stream::level ( ) const
nodiscard

Returns the Severity level of messages this Stream reports.

Definition at line 210 of file Journal.h.

◆ active()

bool beast::Journal::Stream::active ( ) const
nodiscard

Returns true if sink logs anything at this stream's level.

Definition at line 218 of file Journal.h.

◆ operator bool()

beast::Journal::Stream::operator bool ( ) const
explicit

Definition at line 224 of file Journal.h.

◆ operator<<() [1/3]

Journal::ScopedStream beast::Journal::Stream::operator<< ( std::ostream & manipstd::ostream &) const

Output stream support.

Definition at line 145 of file beast_Journal.cpp.

◆ operator<<() [2/3]

template<typename T>
ScopedStream beast::Journal::Stream::operator<< ( T const & t) const

◆ operator<<() [3/3]

template<typename T>
Journal::ScopedStream beast::Journal::Stream::operator<< ( T const & t) const

Definition at line 357 of file Journal.h.

Member Data Documentation

◆ sink_

Sink& beast::Journal::Stream::sink_
private

Definition at line 241 of file Journal.h.

◆ level_

Severity beast::Journal::Stream::level_
private

Definition at line 242 of file Journal.h.