userver: logging::LogHelper Class Reference
Loading...
Searching...
No Matches
logging::LogHelper Class Referencefinal

#include <userver/logging/log_helper.hpp>

Detailed Description

Stream-like tskv-formatted log message builder.

Users can add LogHelper& operator<<(LogHelper&, ) overloads to use a faster localeless logging, rather than outputting data through the ostream operator.

Definition at line 72 of file log_helper.hpp.

Public Member Functions

 LogHelper (LoggerRef logger, Level level, const utils::impl::SourceLocation &location=utils::impl::SourceLocation::Current()) noexcept
 Constructs LogHelper with span logging.
 
 LogHelper (const LoggerPtr &logger, Level level, const utils::impl::SourceLocation &location=utils::impl::SourceLocation::Current()) noexcept
 Constructs LogHelper with span logging.
 
 LogHelper (LogHelper &&)=delete
 
 LogHelper (const LogHelper &)=delete
 
LogHelperoperator= (LogHelper &&)=delete
 
LogHelperoperator= (const LogHelper &)=delete
 
LogHelperAsLvalue () noexcept
 
bool IsLimitReached () const noexcept
 
template<typename T >
LogHelperoperator<< (const T &value)
 
LogHelperoperator<< (char value) noexcept
 
LogHelperoperator<< (std::string_view value) noexcept
 
LogHelperoperator<< (float value) noexcept
 
LogHelperoperator<< (double value) noexcept
 
LogHelperoperator<< (long double value) noexcept
 
LogHelperoperator<< (unsigned long long value) noexcept
 
LogHelperoperator<< (long long value) noexcept
 
LogHelperoperator<< (bool value) noexcept
 
LogHelperoperator<< (const std::exception &value) noexcept
 
LogHelperoperator<< (const LogExtra &extra) noexcept
 Extends internal LogExtra.
 
LogHelperoperator<< (LogExtra &&extra) noexcept
 Extends internal LogExtra.
 
LogHelperoperator<< (const LogExtra::Value &value) noexcept
 
LogHelperoperator<< (Hex hex) noexcept
 
LogHelperoperator<< (HexShort hex) noexcept
 
LogHelperoperator<< (Quoted value) noexcept
 

Constructor & Destructor Documentation

◆ LogHelper() [1/2]

logging::LogHelper::LogHelper ( LoggerRef logger,
Level level,
const utils::impl::SourceLocation & location = utils::impl::SourceLocation::Current() )
noexcept

Constructs LogHelper with span logging.

Parameters
loggerto log to
levelmessage log level
locationsource location that will be written to logs

◆ LogHelper() [2/2]

logging::LogHelper::LogHelper ( const LoggerPtr & logger,
Level level,
const utils::impl::SourceLocation & location = utils::impl::SourceLocation::Current() )
noexcept

Constructs LogHelper with span logging.

Parameters
loggerto log to (logging to nullptr does not output messages)
levelmessage log level
locationsource location that will be written to logs

Member Function Documentation

◆ AsLvalue()

LogHelper & logging::LogHelper::AsLvalue ( )
inlinenoexcept

Definition at line 98 of file log_helper.hpp.

◆ operator<<()

template<typename T >
LogHelper & logging::LogHelper::operator<< ( const T & value)
inline

Definition at line 103 of file log_helper.hpp.


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