#include <userver/utest/log_capture_fixture.hpp>
A mocked logger that stores the log records in memory.
Definition at line 101 of file log_capture_fixture.hpp.
Public Member Functions | |
| LogCaptureLogger (logging::Format format=logging::Format::kRaw) | |
| logging::TextLoggerPtr | GetLogger () const |
| std::vector< LogRecord > | GetAll () const |
| std::vector< LogRecord > | Filter (std::string_view text_substring, utils::span< const std::pair< std::string_view, std::string_view > > tag_substrings={}) const |
| std::vector< LogRecord > | Filter (utils::function_ref< bool(const LogRecord &)> predicate) const |
| void | Clear () noexcept |
| Discards the collected logs. | |
| template<typename T> | |
| std::string | ToStringViaLogging (const T &value) |
| Logs value as-if using LOG_*, then extracts the log text. | |
| std::vector< LogRecord > utest::LogCaptureLogger::Filter | ( | std::string_view | text_substring, |
| utils::span< const std::pair< std::string_view, std::string_view > > | tag_substrings = {} ) const |
| std::vector< LogRecord > utest::LogCaptureLogger::Filter | ( | utils::function_ref< bool(const LogRecord &)> | predicate | ) | const |
| std::vector< LogRecord > utest::LogCaptureLogger::GetAll | ( | ) | const |
| logging::TextLoggerPtr utest::LogCaptureLogger::GetLogger | ( | ) | const |
|
inline |
Logs value as-if using LOG_*, then extracts the log text.
Definition at line 128 of file log_capture_fixture.hpp.