rippled
Public Member Functions | Private Attributes | List of all members
ripple::test::CaptureLogs::CaptureSink Class Reference

sink for writing all log messages to a stringstream More...

Inheritance diagram for ripple::test::CaptureLogs::CaptureSink:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::CaptureLogs::CaptureSink:
Collaboration graph
[legend]

Public Member Functions

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

Private Attributes

std::mutexstrmMutex_
 
std::stringstreamstrm_
 
Severity thresh_
 
bool m_console
 

Detailed Description

sink for writing all log messages to a stringstream

Definition at line 40 of file CaptureLogs.h.

Constructor & Destructor Documentation

◆ CaptureSink()

ripple::test::CaptureLogs::CaptureSink::CaptureSink ( beast::severities::Severity  threshold,
std::mutex mutex,
std::stringstream strm 
)

Definition at line 46 of file CaptureLogs.h.

Member Function Documentation

◆ write()

void ripple::test::CaptureLogs::CaptureSink::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 57 of file CaptureLogs.h.

◆ active()

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

Returns true if text at the passed severity produces output.

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

Definition at line 88 of file beast_Journal.cpp.

◆ console() [1/2]

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

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

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

Definition at line 94 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 100 of file beast_Journal.cpp.

◆ threshold() [1/2]

severities::Severity beast::Journal::Sink::threshold ( ) const
virtualinherited

Returns the minimum severity level this sink will report.

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

Definition at line 106 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 112 of file beast_Journal.cpp.

Member Data Documentation

◆ strmMutex_

std::mutex& ripple::test::CaptureLogs::CaptureSink::strmMutex_
private

Definition at line 42 of file CaptureLogs.h.

◆ strm_

std::stringstream& ripple::test::CaptureLogs::CaptureSink::strm_
private

Definition at line 43 of file CaptureLogs.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.