xrpld
Loading...
Searching...
No Matches
beast::Journal::Sink Class Referenceabstract

Abstraction for the underlying message destination. More...

#include <Journal.h>

Inheritance diagram for beast::Journal::Sink:

Public Member Functions

virtual ~Sink ()=0
 Sink ()=delete
Sinkoperator= (Sink const &lhs)=delete
virtual bool active (Severity level) const
 Returns true if text at the passed severity produces output.
virtual bool console () const
 Returns true if a message is also written to the Output Window (MSVC).
virtual void console (bool output)
 Set whether messages are also written to the Output Window (MSVC).
virtual Severity threshold () const
 Returns the minimum severity level this sink will report.
virtual void threshold (Severity thresh)
 Set the minimum severity this sink will report.
virtual void write (Severity level, std::string const &text)=0
 Write text to the sink at the specified severity.
virtual void writeAlways (Severity level, std::string const &text)=0
 Bypass filter and write text to the sink at the specified severity.

Protected Member Functions

 Sink (Sink const &sink)=default
 Sink (Severity thresh, bool console)

Private Attributes

Severity thresh_
bool console_

Detailed Description

Abstraction for the underlying message destination.

Definition at line 50 of file Journal.h.

Constructor & Destructor Documentation

◆ Sink() [1/3]

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

◆ Sink() [2/3]

beast::Journal::Sink::Sink ( Severity thresh,
bool console )
protected

Definition at line 71 of file beast_Journal.cpp.

◆ ~Sink()

beast::Journal::Sink::~Sink ( )
pure virtualdefault

◆ Sink() [3/3]

beast::Journal::Sink::Sink ( )
delete

Member Function Documentation

◆ operator=()

Sink & beast::Journal::Sink::operator= ( Sink const & lhs)
delete

◆ active()

bool beast::Journal::Sink::active ( Severity level) const
nodiscardvirtual

Returns true if text at the passed severity produces output.

Reimplemented in beast::NullJournalSink, beast::WrappedSink, and xrpl::test::SuiteJournalSink.

Definition at line 78 of file beast_Journal.cpp.

◆ console() [1/2]

bool beast::Journal::Sink::console ( ) const
nodiscardvirtual

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

Reimplemented in beast::NullJournalSink, and beast::WrappedSink.

Definition at line 84 of file beast_Journal.cpp.

◆ console() [2/2]

void beast::Journal::Sink::console ( bool output)
virtual

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

Reimplemented in beast::NullJournalSink, and beast::WrappedSink.

Definition at line 90 of file beast_Journal.cpp.

◆ threshold() [1/2]

Severity beast::Journal::Sink::threshold ( ) const
nodiscardvirtual

Returns the minimum severity level this sink will report.

Reimplemented in beast::NullJournalSink, and beast::WrappedSink.

Definition at line 96 of file beast_Journal.cpp.

◆ threshold() [2/2]

void beast::Journal::Sink::threshold ( Severity thresh)
virtual

Set the minimum severity this sink will report.

Reimplemented in beast::NullJournalSink, and beast::WrappedSink.

Definition at line 102 of file beast_Journal.cpp.

◆ write()

virtual void beast::Journal::Sink::write ( Severity level,
std::string const & text )
pure virtual

◆ writeAlways()

virtual void beast::Journal::Sink::writeAlways ( Severity level,
std::string const & text )
pure virtual

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.

Implemented in beast::Journal_test::TestSink, beast::NullJournalSink, beast::WrappedSink, xrpl::Logs::Sink, xrpl::test::CaptureLogs::CaptureSink, xrpl::test::CheckMessageLogs::CheckMessageSink, xrpl::test::csf::BasicSink, xrpl::test::Server_test::TestSink, xrpl::test::StreamSink, xrpl::test::SuiteJournalSink, and xrpl::TestSink.

Member Data Documentation

◆ thresh_

Severity beast::Journal::Sink::thresh_
private

Definition at line 103 of file Journal.h.

◆ console_

bool beast::Journal::Sink::console_
private

Definition at line 104 of file Journal.h.