rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
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:
Collaboration graph
[legend]

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

Sinkm_sink
 
Severity m_level
 

Detailed Description

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

Definition at line 204 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 208 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 217 of file Journal.h.

◆ Stream() [3/3]

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

Construct or copy another Stream.

Definition at line 225 of file Journal.h.

Member Function Documentation

◆ operator=()

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

◆ sink()

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

Returns the Sink that this Stream writes to.

Definition at line 234 of file Journal.h.

◆ level()

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

Returns the Severity level of messages this Stream reports.

Definition at line 241 of file Journal.h.

◆ active()

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

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

Definition at line 249 of file Journal.h.

◆ operator bool()

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

Definition at line 255 of file Journal.h.

◆ operator<<() [1/3]

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

Output stream support.

Definition at line 164 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 388 of file Journal.h.

Member Data Documentation

◆ m_sink

Sink& beast::Journal::Stream::m_sink
private

Definition at line 272 of file Journal.h.

◆ m_level

Severity beast::Journal::Stream::m_level
private

Definition at line 273 of file Journal.h.