kanzi::detail::LogRecord Class Reference

This class represents log record that accumulates multiple log messages and writes them as a sole message to the logger when object of this class is destroyed. More...

#include <kanzi/core/log/log_record.hpp>

Public Member Functions

 LogRecord (AbstractLogger &logger, LogLevel level, string_view levelName, string_view categoryName, string_view fileName, size_t lineNumber)
 Constructor. More...
 
 ~LogRecord ()
 Writes accumulated log messages to logger. More...
 
template<typename T >
void appendMessage (const T &value)
 Appends single value message to log storage. More...
 

Detailed Description

This class represents log record that accumulates multiple log messages and writes them as a sole message to the logger when object of this class is destroyed.

This class is used internally by Logging subsystem. The object of this class is aimed to accumulate multiple log message with same log level and log category. The log messages are written to logger when object is destroyed. The logger is passed as constructor parameter.

Constructor & Destructor Documentation

kanzi::detail::LogRecord::LogRecord ( AbstractLogger logger,
LogLevel  level,
string_view  levelName,
string_view  categoryName,
string_view  fileName,
size_t  lineNumber 
)
inlineexplicit

Constructor.

Constructors Log Record object.

Parameters
loggerThe logger to be used to write log messages
levelThe log level of the message.
levelNameThe string representation of log level.
categoryNameThe string representation of log category.
fileNameThe name of the file log message is originated from.
lineNumberThe line number of the place in file where log message is originated.
kanzi::detail::LogRecord::~LogRecord ( )
inline

Writes accumulated log messages to logger.

Member Function Documentation

template<typename T >
void kanzi::detail::LogRecord::appendMessage ( const T &  value)
inline

Appends single value message to log storage.

Parameters
valueThe value to be converted to string and added to log storage.

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