xrpld
Loading...
Searching...
No Matches
beast::WrappedSink Class Reference

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

#include <WrappedSink.h>

Inheritance diagram for beast::WrappedSink:
Collaboration diagram for beast::WrappedSink:

Public Member Functions

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

Private Attributes

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

Detailed Description

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

Definition at line 15 of file WrappedSink.h.

Constructor & Destructor Documentation

◆ WrappedSink() [1/2]

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

Definition at line 22 of file WrappedSink.h.

◆ WrappedSink() [2/2]

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

Definition at line 27 of file WrappedSink.h.

Member Function Documentation

◆ prefix()

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

Definition at line 33 of file WrappedSink.h.

◆ active()

bool beast::WrappedSink::active ( beast::Severity level) const
nodiscardoverridevirtual

Returns true if text at the passed severity produces output.

Reimplemented from beast::Journal::Sink.

Definition at line 39 of file WrappedSink.h.

◆ console() [1/2]

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

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

Reimplemented from beast::Journal::Sink.

Definition at line 45 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 51 of file WrappedSink.h.

◆ threshold() [1/2]

beast::Severity beast::WrappedSink::threshold ( ) const
nodiscardoverridevirtual

Returns the minimum severity level this sink will report.

Reimplemented from beast::Journal::Sink.

Definition at line 57 of file WrappedSink.h.

◆ threshold() [2/2]

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

Set the minimum severity this sink will report.

Reimplemented from beast::Journal::Sink.

Definition at line 63 of file WrappedSink.h.

◆ write()

void beast::WrappedSink::write ( beast::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 69 of file WrappedSink.h.

◆ writeAlways()

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

Bypass filter and write text to the sink at the specified severity.

Always write the message, but maintain the same formatting as if it passed through a level filter.

Parameters
levelLevel to display in message.
textText to write to sink.

Implements beast::Journal::Sink.

Definition at line 76 of file WrappedSink.h.

Member Data Documentation

◆ sink_

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

Definition at line 18 of file WrappedSink.h.

◆ prefix_

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

Definition at line 19 of file WrappedSink.h.

◆ thresh_

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

Definition at line 103 of file Journal.h.

◆ console_

bool beast::Journal::Sink::console_
privateinherited

Definition at line 104 of file Journal.h.