userver: userver/utest/log_capture_fixture.hpp File Reference
Loading...
Searching...
No Matches
log_capture_fixture.hpp File Reference

Detailed Description

Fixture that allows to capture and extract log written into the default logger.

Definition in file log_capture_fixture.hpp.

Go to the source code of this file.

#include <iosfwd>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
#include <userver/logging/impl/logger_base.hpp>
#include <userver/logging/level.hpp>
#include <userver/logging/log.hpp>
#include <userver/utest/default_logger_fixture.hpp>
#include <userver/utils/function_ref.hpp>
#include <userver/utils/impl/internal_tag.hpp>
#include <userver/utils/impl/source_location.hpp>
#include <userver/utils/not_null.hpp>
#include <userver/utils/span.hpp>

Classes

class  utest::LogRecord
 Represents single log record, typically written via LOG_* macros. More...
 
class  utest::NotSingleLogError
 Thrown by GetSingleLog. More...
 
class  utest::LogCaptureLogger
 A mocked logger that stores the log records in memory. More...
 
class  utest::LogCaptureFixture< Base >
 Fixture that allows to capture and extract log written into the default logger. More...
 

Namespaces

namespace  utest
 Mocks and test helpers.
 

Functions

std::ostream & utest::operator<< (std::ostream &, const LogRecord &data)
 
std::ostream & utest::operator<< (std::ostream &, const std::vector< LogRecord > &data)
 
LogRecord utest::GetSingleLog (utils::span< const LogRecord > log, const utils::impl::SourceLocation &source_location=utils::impl::SourceLocation::Current())