#include <userver/utest/log_capture_fixture.hpp>
A mocked logger that stores the log records in memory.
- See also
- utest::LogCaptureFixture
Definition at line 88 of file log_capture_fixture.hpp.
|
| LogCaptureLogger (logging::Format format=logging::Format::kRaw) |
|
logging::LoggerPtr | 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.
|
|
◆ Filter() [1/2]
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 |
- Returns
- logs filtered by (optional) text substring and (optional) tags substrings.
- See also
- GetSingleLog
◆ Filter() [2/2]
std::vector< LogRecord > utest::LogCaptureLogger::Filter |
( |
utils::function_ref< bool(const LogRecord &)> | predicate | ) |
const |
- Returns
- logs filtered by an arbitrary predicate.
- See also
- GetSingleLog
◆ GetAll()
std::vector< LogRecord > utest::LogCaptureLogger::GetAll |
( |
| ) |
const |
◆ GetLogger()
logging::LoggerPtr utest::LogCaptureLogger::GetLogger |
( |
| ) |
const |
- Returns
- the mocked logger.
◆ ToStringViaLogging()
template<typename T >
std::string utest::LogCaptureLogger::ToStringViaLogging |
( |
const T & | value | ) |
|
|
inline |
The documentation for this class was generated from the following file: