xrpld
Loading...
Searching...
No Matches
xrpl::test::jtx::SuiteLogs Class Reference

#include <Env.h>

Inheritance diagram for xrpl::test::jtx::SuiteLogs:
Collaboration diagram for xrpl::test::jtx::SuiteLogs:

Public Member Functions

 SuiteLogs (beast::unit_test::Suite &suite)
 ~SuiteLogs () override=default
std::unique_ptr< beast::Journal::SinkmakeSink (std::string const &partition, beast::Severity threshold) override
bool open (boost::filesystem::path const &pathToLogFile)
beast::Journal::Sinkget (std::string const &name)
beast::Journal::Sinkoperator[] (std::string const &name)
beast::Journal journal (std::string const &name)
beast::Severity threshold () const
void threshold (beast::Severity thresh)
std::vector< std::pair< std::string, std::string > > partitionSeverities () const
void write (beast::Severity level, std::string const &partition, std::string const &text, bool console)
std::string rotate ()
void silent (bool bSilent)
 Set flag to write logs to stderr (false) or not (true).

Static Public Member Functions

static std::string toString (beast::Severity s)
static std::optional< beast::SeverityfromString (std::string const &s)

Static Private Member Functions

static void format (std::string &output, std::string const &message, beast::Severity severity, std::string const &partition)

Private Attributes

beast::unit_test::Suitesuite_
std::mutex mutex_
std::map< std::string, std::unique_ptr< beast::Journal::Sink >, boost::beast::iless > sinks_
beast::Severity thresh_
File file_
bool silent_ = false

Static Private Attributes

static constexpr auto kMaximumMessageCharacters = 12 * 1024

Detailed Description

Definition at line 121 of file Env.h.

Constructor & Destructor Documentation

◆ SuiteLogs()

xrpl::test::jtx::SuiteLogs::SuiteLogs ( beast::unit_test::Suite & suite)
explicit

Definition at line 126 of file Env.h.

◆ ~SuiteLogs()

xrpl::test::jtx::SuiteLogs::~SuiteLogs ( )
overridedefault

Member Function Documentation

◆ makeSink()

std::unique_ptr< beast::Journal::Sink > xrpl::test::jtx::SuiteLogs::makeSink ( std::string const & partition,
beast::Severity threshold )
overridevirtual

Reimplemented from xrpl::Logs.

Definition at line 133 of file Env.h.

◆ open()

bool xrpl::Logs::open ( boost::filesystem::path const & pathToLogFile)
inherited

Definition at line 117 of file Log.cpp.

◆ get()

beast::Journal::Sink & xrpl::Logs::get ( std::string const & name)
inherited

Definition at line 123 of file Log.cpp.

◆ operator[]()

beast::Journal::Sink & xrpl::Logs::operator[] ( std::string const & name)
inherited

Definition at line 131 of file Log.cpp.

◆ journal()

beast::Journal xrpl::Logs::journal ( std::string const & name)
inherited

Definition at line 137 of file Log.cpp.

◆ threshold() [1/2]

beast::Severity xrpl::Logs::threshold ( ) const
inherited

Definition at line 143 of file Log.cpp.

◆ threshold() [2/2]

void xrpl::Logs::threshold ( beast::Severity thresh)
inherited

Definition at line 149 of file Log.cpp.

◆ partitionSeverities()

std::vector< std::pair< std::string, std::string > > xrpl::Logs::partitionSeverities ( ) const
inherited

Definition at line 158 of file Log.cpp.

◆ write()

void xrpl::Logs::write ( beast::Severity level,
std::string const & partition,
std::string const & text,
bool console )
inherited

Definition at line 169 of file Log.cpp.

◆ rotate()

std::string xrpl::Logs::rotate ( )
inherited

Definition at line 187 of file Log.cpp.

◆ silent()

void xrpl::Logs::silent ( bool bSilent)
inherited

Set flag to write logs to stderr (false) or not (true).

Parameters
bSilentSet flag accordingly.

Definition at line 176 of file Log.h.

◆ toString()

std::string xrpl::Logs::toString ( beast::Severity s)
staticinherited

Definition at line 203 of file Log.cpp.

◆ fromString()

std::optional< beast::Severity > xrpl::Logs::fromString ( std::string const & s)
staticinherited

Definition at line 228 of file Log.cpp.

◆ format()

void xrpl::Logs::format ( std::string & output,
std::string const & message,
beast::Severity severity,
std::string const & partition )
staticprivateinherited

Definition at line 252 of file Log.cpp.

Member Data Documentation

◆ suite_

beast::unit_test::Suite& xrpl::test::jtx::SuiteLogs::suite_
private

Definition at line 123 of file Env.h.

◆ mutex_

std::mutex xrpl::Logs::mutex_
mutableprivateinherited

Definition at line 124 of file Log.h.

◆ sinks_

std::map<std::string, std::unique_ptr<beast::Journal::Sink>, boost::beast::iless> xrpl::Logs::sinks_
privateinherited

Definition at line 125 of file Log.h.

◆ thresh_

beast::Severity xrpl::Logs::thresh_
privateinherited

Definition at line 126 of file Log.h.

◆ file_

File xrpl::Logs::file_
privateinherited

Definition at line 127 of file Log.h.

◆ silent_

bool xrpl::Logs::silent_ = false
privateinherited

Definition at line 128 of file Log.h.

◆ kMaximumMessageCharacters

auto xrpl::Logs::kMaximumMessageCharacters = 12 * 1024
staticconstexprprivateinherited

Definition at line 194 of file Log.h.