rippled
Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
ripple::test::jtx::SuiteLogs Class Reference
Inheritance diagram for ripple::test::jtx::SuiteLogs:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::jtx::SuiteLogs:
Collaboration graph
[legend]

Public Member Functions

 SuiteLogs (beast::unit_test::suite &suite)
 
 ~SuiteLogs () override=default
 
std::unique_ptr< beast::Journal::SinkmakeSink (std::string const &partition, beast::severities::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::severities::Severity threshold () const
 
void threshold (beast::severities::Severity thresh)
 
std::vector< std::pair< std::string, std::string > > partition_severities () const
 
void write (beast::severities::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). More...
 

Static Public Member Functions

static LogSeverity fromSeverity (beast::severities::Severity level)
 
static beast::severities::Severity toSeverity (LogSeverity level)
 
static std::string toString (LogSeverity s)
 
static LogSeverity fromString (std::string const &s)
 

Private Types

enum  { maximumMessageCharacters = 12 * 1024 }
 

Static Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 92 of file Env.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
maximumMessageCharacters 

Definition at line 234 of file Log.h.

Constructor & Destructor Documentation

◆ SuiteLogs()

ripple::test::jtx::SuiteLogs::SuiteLogs ( beast::unit_test::suite &  suite)
explicit

Definition at line 97 of file Env.h.

◆ ~SuiteLogs()

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

Member Function Documentation

◆ makeSink()

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

Reimplemented from ripple::Logs.

Definition at line 105 of file Env.h.

◆ open()

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

Definition at line 124 of file Log.cpp.

◆ get()

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

Definition at line 130 of file Log.cpp.

◆ operator[]()

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

Definition at line 138 of file Log.cpp.

◆ journal()

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

Definition at line 144 of file Log.cpp.

◆ threshold() [1/2]

beast::severities::Severity ripple::Logs::threshold ( ) const
inherited

Definition at line 150 of file Log.cpp.

◆ threshold() [2/2]

void ripple::Logs::threshold ( beast::severities::Severity  thresh)
inherited

Definition at line 156 of file Log.cpp.

◆ partition_severities()

std::vector< std::pair< std::string, std::string > > ripple::Logs::partition_severities ( ) const
inherited

Definition at line 165 of file Log.cpp.

◆ write()

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

Definition at line 176 of file Log.cpp.

◆ rotate()

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

Definition at line 194 of file Log.cpp.

◆ silent()

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

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

Parameters
bSilentSet flag accordingly.

Definition at line 210 of file Log.h.

◆ fromSeverity()

LogSeverity ripple::Logs::fromSeverity ( beast::severities::Severity  level)
staticinherited

Definition at line 210 of file Log.cpp.

◆ toSeverity()

beast::severities::Severity ripple::Logs::toSeverity ( LogSeverity  level)
staticinherited

Definition at line 237 of file Log.cpp.

◆ toString()

std::string ripple::Logs::toString ( LogSeverity  s)
staticinherited

Definition at line 263 of file Log.cpp.

◆ fromString()

LogSeverity ripple::Logs::fromString ( std::string const &  s)
staticinherited

Definition at line 286 of file Log.cpp.

◆ format()

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

Definition at line 311 of file Log.cpp.

Member Data Documentation

◆ suite_

beast::unit_test::suite& ripple::test::jtx::SuiteLogs::suite_
private

Definition at line 94 of file Env.h.

◆ mutex_

std::mutex ripple::Logs::mutex_
mutableprivateinherited

Definition at line 154 of file Log.h.

◆ sinks_

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

Definition at line 159 of file Log.h.

◆ thresh_

beast::severities::Severity ripple::Logs::thresh_
privateinherited

Definition at line 160 of file Log.h.

◆ file_

File ripple::Logs::file_
privateinherited

Definition at line 161 of file Log.h.

◆ silent_

bool ripple::Logs::silent_ = false
privateinherited

Definition at line 162 of file Log.h.