rippled
Public Member Functions | Private Attributes | List of all members
beast::WrappedSink Class Reference

Wraps a Journal::Sink to prefix its output with a string. More...

Inheritance diagram for beast::WrappedSink:
Inheritance graph
[legend]
Collaboration diagram for beast::WrappedSink:
Collaboration graph
[legend]

Public Member Functions

 WrappedSink (beast::Journal::Sink &sink, std::string const &prefix="")
 
 WrappedSink (beast::Journal const &journal, std::string const &prefix="")
 
void prefix (std::string const &s)
 
bool active (beast::severities::Severity level) const override
 Returns true if text at the passed severity produces output. More...
 
bool console () const override
 Returns true if a message is also written to the Output Window (MSVC). More...
 
void console (bool output) override
 Set whether messages are also written to the Output Window (MSVC). More...
 
beast::severities::Severity threshold () const override
 Returns the minimum severity level this sink will report. More...
 
void threshold (beast::severities::Severity thresh) override
 Set the minimum severity this sink will report. More...
 
void write (beast::severities::Severity level, std::string const &text) override
 Write text to the sink at the specified severity. More...
 

Private Attributes

beast::Journal::Sinksink_
 
std::string prefix_
 
Severity thresh_
 
bool m_console
 

Detailed Description

Wraps a Journal::Sink to prefix its output with a string.

Definition at line 33 of file WrappedSink.h.

Constructor & Destructor Documentation

◆ WrappedSink() [1/2]

beast::WrappedSink::WrappedSink ( beast::Journal::Sink sink,
std::string const &  prefix = "" 
)
explicit

Definition at line 40 of file WrappedSink.h.

◆ WrappedSink() [2/2]

beast::WrappedSink::WrappedSink ( beast::Journal const &  journal,
std::string const &  prefix = "" 
)
explicit

Definition at line 47 of file WrappedSink.h.

Member Function Documentation

◆ prefix()

void beast::WrappedSink::prefix ( std::string const &  s)

Definition at line 55 of file WrappedSink.h.

◆ active()

bool beast::WrappedSink::active ( beast::severities::Severity  level) const
overridevirtual

Returns true if text at the passed severity produces output.

Reimplemented from beast::Journal::Sink.

Definition at line 61 of file WrappedSink.h.

◆ console() [1/2]

bool beast::WrappedSink::console ( ) const
overridevirtual

Returns true if a message is also written to the Output Window (MSVC).

Reimplemented from beast::Journal::Sink.

Definition at line 67 of file WrappedSink.h.

◆ console() [2/2]

void beast::WrappedSink::console ( bool  output)
overridevirtual

Set whether messages are also written to the Output Window (MSVC).

Reimplemented from beast::Journal::Sink.

Definition at line 73 of file WrappedSink.h.

◆ threshold() [1/2]

beast::severities::Severity beast::WrappedSink::threshold ( ) const
overridevirtual

Returns the minimum severity level this sink will report.

Reimplemented from beast::Journal::Sink.

Definition at line 79 of file WrappedSink.h.

◆ threshold() [2/2]

void beast::WrappedSink::threshold ( beast::severities::Severity  thresh)
overridevirtual

Set the minimum severity this sink will report.

Reimplemented from beast::Journal::Sink.

Definition at line 85 of file WrappedSink.h.

◆ write()

void beast::WrappedSink::write ( beast::severities::Severity  level,
std::string const &  text 
)
overridevirtual

Write text to the sink at the specified severity.

A conforming implementation will not write the text if the passed level is below the current threshold().

Implements beast::Journal::Sink.

Definition at line 91 of file WrappedSink.h.

Member Data Documentation

◆ sink_

beast::Journal::Sink& beast::WrappedSink::sink_
private

Definition at line 36 of file WrappedSink.h.

◆ prefix_

std::string beast::WrappedSink::prefix_
private

Definition at line 37 of file WrappedSink.h.

◆ thresh_

Severity beast::Journal::Sink::thresh_
privateinherited

Definition at line 116 of file Journal.h.

◆ m_console

bool beast::Journal::Sink::m_console
privateinherited

Definition at line 117 of file Journal.h.