1#include <helpers/TestSink.h>
3#include <xrpl/beast/utility/Journal.h>
5#include <boost/predef.h>
36 auto supportsColor = [] {
55 return _isatty(_fileno(stdout)) != 0;
60 return isatty(STDOUT_FILENO) != 0;
64 auto color = [level]() {
84 auto prefix = [level]() {
115 static constexpr auto kReset =
"\033[0m";
119 stream << color << prefix <<
" " << text << kReset <<
std::endl;
123 stream << prefix <<
" " << text <<
std::endl;
virtual Severity threshold() const
Returns the minimum severity level this sink will report.
Sink(Sink const &sink)=default
void write(beast::Severity level, std::string const &text) override
Write text to the sink at the specified severity.
TestSink(beast::Severity threshold=beast::Severity::Debug)
void writeAlways(beast::Severity level, std::string const &text) override
Bypass filter and write text to the sink at the specified severity.
Severity
Severity level / threshold of a Journal message.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.