userver: utest::LogRecord Class Reference
Loading...
Searching...
No Matches
utest::LogRecord Class Referencefinal

#include <userver/utest/log_capture_fixture.hpp>

Detailed Description

Represents single log record, typically written via LOG_* macros.

See also
utest::LogCaptureLogger
utest::LogCaptureFixture

Definition at line 36 of file log_capture_fixture.hpp.

Public Member Functions

const std::string & GetText () const
 
const std::string & GetTag (std::string_view key) const
 
std::optional< std::string > GetTagOptional (std::string_view key) const
 
const std::string * GetTagOrNullptr (std::string_view key) const
 
const std::string & GetLogRaw () const
 
logging::Level GetLevel () const
 

Member Function Documentation

◆ GetLevel()

logging::Level utest::LogRecord::GetLevel ( ) const
Returns
the log level of the record

◆ GetLogRaw()

const std::string & utest::LogRecord::GetLogRaw ( ) const
Returns
serialized log record

◆ GetTag()

const std::string & utest::LogRecord::GetTag ( std::string_view key) const
Returns
decoded value of the tag in the log record
Exceptions
ifno such tag in the log

◆ GetTagOptional()

std::optional< std::string > utest::LogRecord::GetTagOptional ( std::string_view key) const
Returns
decoded value of the tag in the log record, or std::nullopt

◆ GetTagOrNullptr()

const std::string * utest::LogRecord::GetTagOrNullptr ( std::string_view key) const
Returns
decoded value of the tag in the log record, or nullptr

◆ GetText()

const std::string & utest::LogRecord::GetText ( ) const
Returns
decoded text of the log record
Exceptions
ifno 'text' tag in the log

The documentation for this class was generated from the following file: