rippled
Classes | Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
ripple::test::CheckMessageLogs Class Reference

Log manager that searches for a specific message substring. More...

Inheritance diagram for ripple::test::CheckMessageLogs:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::CheckMessageLogs:
Collaboration graph
[legend]

Classes

class  CheckMessageSink
 

Public Member Functions

 CheckMessageLogs (std::string msg, bool *pFound)
 Constructor. More...
 
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

std::string msg_
 
bool * pFound_
 
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

Log manager that searches for a specific message substring.

Definition at line 27 of file CheckMessageLogs.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
maximumMessageCharacters 

Definition at line 234 of file Log.h.

Constructor & Destructor Documentation

◆ CheckMessageLogs()

ripple::test::CheckMessageLogs::CheckMessageLogs ( std::string  msg,
bool *  pFound 
)

Constructor.

Parameters
msgThe message string to search for
pFoundPointer to the variable to set to true if the message is found

Definition at line 60 of file CheckMessageLogs.h.

Member Function Documentation

◆ makeSink()

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

Reimplemented from ripple::Logs.

Definition at line 66 of file CheckMessageLogs.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

◆ msg_

std::string ripple::test::CheckMessageLogs::msg_
private

Definition at line 29 of file CheckMessageLogs.h.

◆ pFound_

bool* ripple::test::CheckMessageLogs::pFound_
private

Definition at line 30 of file CheckMessageLogs.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.