rippled
Loading...
Searching...
No Matches
CheckMessageLogs.h
1#ifndef XRPL_TEST_JTX_CHECKMESSAGELOGS_H_INCLUDED
2#define XRPL_TEST_JTX_CHECKMESSAGELOGS_H_INCLUDED
3
4#include <xrpl/basics/Log.h>
5
6namespace ripple {
7namespace test {
8
11class CheckMessageLogs : public Logs
12{
14 bool* pFound_;
15
17 {
19
20 public:
23 CheckMessageLogs& owner)
24 : beast::Journal::Sink(threshold, false), owner_(owner)
25 {
26 }
27
28 void
30 override
31 {
32 if (text.find(owner_.msg_) != std::string::npos)
33 *owner_.pFound_ = true;
34 }
35
36 void
38 override
39 {
40 write(level, text);
41 }
42 };
43
44public:
51 CheckMessageLogs(std::string msg, bool* pFound)
52 : Logs{beast::severities::kDebug}, msg_{std::move(msg)}, pFound_{pFound}
53 {
54 }
55
58 std::string const& partition,
60 {
62 }
63};
64
65} // namespace test
66} // namespace ripple
67
68#endif
Abstraction for the underlying message destination.
Definition Journal.h:57
virtual Severity threshold() const
Returns the minimum severity level this sink will report.
Manages partitions for logging.
Definition Log.h:33
beast::severities::Severity threshold() const
Definition Log.cpp:147
CheckMessageSink(beast::severities::Severity threshold, CheckMessageLogs &owner)
void write(beast::severities::Severity level, std::string const &text) override
Write text to the sink at the specified severity.
void writeAlways(beast::severities::Severity level, std::string const &text) override
Bypass filter and write text to the sink at the specified severity.
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:13
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
STL namespace.