rippled
Loading...
Searching...
No Matches
CheckMessageLogs.h
1#pragma once
2
3#include <xrpl/basics/Log.h>
4
5namespace xrpl {
6namespace test {
7
10class CheckMessageLogs : public Logs
11{
13 bool* pFound_;
14
16 {
18
19 public:
24
25 void
26 write(beast::severities::Severity level, std::string const& text) override
27 {
28 if (text.find(owner_.msg_) != std::string::npos)
29 *owner_.pFound_ = true;
30 }
31
32 void
34 {
35 write(level, text);
36 }
37 };
38
39public:
46 CheckMessageLogs(std::string msg, bool* pFound)
47 : Logs{beast::severities::kDebug}, msg_{std::move(msg)}, pFound_{pFound}
48 {
49 }
50
56};
57
58} // namespace test
59} // namespace xrpl
Abstraction for the underlying message destination.
Definition Journal.h:56
virtual Severity threshold() const
Returns the minimum severity level this sink will report.
Manages partitions for logging.
Definition Log.h:32
beast::severities::Severity threshold() const
Definition Log.cpp:140
void writeAlways(beast::severities::Severity level, std::string const &text) override
Bypass filter and write text to the sink at the specified severity.
void write(beast::severities::Severity level, std::string const &text) override
Write text to the sink at the specified severity.
CheckMessageSink(beast::severities::Severity threshold, CheckMessageLogs &owner)
Log manager that searches for a specific message substring.
CheckMessageLogs(std::string msg, bool *pFound)
Constructor.
std::unique_ptr< beast::Journal::Sink > makeSink(std::string const &partition, beast::severities::Severity threshold) override
T find(T... args)
T is_same_v
Severity
Severity level / threshold of a Journal message.
Definition Journal.h:12
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5