xrpld
Loading...
Searching...
No Matches
beast::Journal_test::TestSink Class Reference
Inheritance diagram for beast::Journal_test::TestSink:
Collaboration diagram for beast::Journal_test::TestSink:

Public Member Functions

 TestSink ()
int count () const
void reset ()
void write (Severity level, std::string const &) override
 Write text to the sink at the specified severity.
void writeAlways (Severity level, std::string const &) override
 Bypass filter and write text to the sink at the specified severity.
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.

Private Attributes

int count_ {0}
Severity thresh_
bool console_

Detailed Description

Definition at line 11 of file beast_Journal_test.cpp.

Constructor & Destructor Documentation

◆ TestSink()

beast::Journal_test::TestSink::TestSink ( )

Definition at line 17 of file beast_Journal_test.cpp.

Member Function Documentation

◆ count()

int beast::Journal_test::TestSink::count ( ) const
nodiscard

Definition at line 22 of file beast_Journal_test.cpp.

◆ reset()

void beast::Journal_test::TestSink::reset ( )

Definition at line 28 of file beast_Journal_test.cpp.

◆ write()

void beast::Journal_test::TestSink::write ( 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 34 of file beast_Journal_test.cpp.

◆ writeAlways()

void beast::Journal_test::TestSink::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 41 of file beast_Journal_test.cpp.

◆ active()

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

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
nodiscardvirtualinherited

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)
virtualinherited

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
nodiscardvirtualinherited

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)
virtualinherited

Set the minimum severity this sink will report.

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

Definition at line 102 of file beast_Journal.cpp.

Member Data Documentation

◆ count_

int beast::Journal_test::TestSink::count_ {0}
private

Definition at line 14 of file beast_Journal_test.cpp.

◆ 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.