xrpld
Loading...
Searching...
No Matches
xrpl::test::SHAMapStore_test::StoreLogs Class Reference
Inheritance diagram for xrpl::test::SHAMapStore_test::StoreLogs:
Collaboration diagram for xrpl::test::SHAMapStore_test::StoreLogs:

Classes

class  Sink

Public Member Functions

 StoreLogs ()
std::unique_ptr< beast::Journal::Sink > makeSink (std::string const &partition, beast::Severity) override
std::size_t count (beast::Severity severity, std::string const &text) const
std::size_t count (std::string const &text) const
bool waitFor (std::optional< beast::Severity > severity, std::string const &text, std::chrono::milliseconds timeout, std::size_t expected=1)
bool waitFor (std::string const &text, std::chrono::milliseconds timeout, std::size_t expected=1)
bool open (std::filesystem::path const &pathToLogFile)
beast::Journal::Sink & get (std::string const &name)
beast::Journal::Sink & operator[] (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::Severity > fromString (std::string const &s)

Private Member Functions

std::size_t countLocked (std::optional< beast::Severity > severity, std::string const &text) const

Static Private Member Functions

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

Private Attributes

std::mutex mutex_
std::condition_variable cond_
std::vector< std::pair< beast::Severity, std::string > > messages_
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 107 of file SHAMapStore_test.cpp.

Constructor & Destructor Documentation

◆ StoreLogs()

xrpl::test::SHAMapStore_test::StoreLogs::StoreLogs ( )

Definition at line 159 of file SHAMapStore_test.cpp.

Member Function Documentation

◆ countLocked()

std::size_t xrpl::test::SHAMapStore_test::StoreLogs::countLocked ( std::optional< beast::Severity > severity,
std::string const & text ) const
nodiscardprivate

Definition at line 150 of file SHAMapStore_test.cpp.

◆ makeSink()

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

Reimplemented from xrpl::Logs.

Definition at line 167 of file SHAMapStore_test.cpp.

◆ count() [1/2]

std::size_t xrpl::test::SHAMapStore_test::StoreLogs::count ( beast::Severity severity,
std::string const & text ) const
nodiscard

Definition at line 177 of file SHAMapStore_test.cpp.

◆ count() [2/2]

std::size_t xrpl::test::SHAMapStore_test::StoreLogs::count ( std::string const & text) const
nodiscard

Definition at line 185 of file SHAMapStore_test.cpp.

◆ waitFor() [1/2]

bool xrpl::test::SHAMapStore_test::StoreLogs::waitFor ( std::optional< beast::Severity > severity,
std::string const & text,
std::chrono::milliseconds timeout,
std::size_t expected = 1 )
nodiscard

Definition at line 201 of file SHAMapStore_test.cpp.

◆ waitFor() [2/2]

bool xrpl::test::SHAMapStore_test::StoreLogs::waitFor ( std::string const & text,
std::chrono::milliseconds timeout,
std::size_t expected = 1 )
nodiscard

Definition at line 214 of file SHAMapStore_test.cpp.

◆ open()

bool xrpl::Logs::open ( std::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 191 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

◆ mutex_

std::mutex xrpl::test::SHAMapStore_test::StoreLogs::mutex_
mutableprivate

Definition at line 109 of file SHAMapStore_test.cpp.

◆ cond_

std::condition_variable xrpl::test::SHAMapStore_test::StoreLogs::cond_
private

Definition at line 110 of file SHAMapStore_test.cpp.

◆ messages_

std::vector<std::pair<beast::Severity, std::string> > xrpl::test::SHAMapStore_test::StoreLogs::messages_
private

Definition at line 111 of file SHAMapStore_test.cpp.

◆ sinks_

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

Definition at line 140 of file Log.h.

◆ thresh_

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

Definition at line 141 of file Log.h.

◆ file_

File xrpl::Logs::file_
privateinherited

Definition at line 142 of file Log.h.

◆ silent_

bool xrpl::Logs::silent_ = false
privateinherited

Definition at line 143 of file Log.h.

◆ kMaximumMessageCharacters

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

Definition at line 209 of file Log.h.