kanzi::detail::LogRecord Class Reference

This class represents a log record that accumulates multiple log messages and writes them to the logger as a single message when the 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 the logger. More...
 
template<typename T >
void appendMessage (const T &value)
 Appends a single value message to the log storage. More...
 

Detailed Description

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

This class is used internally by the Logging subsystem. The object of this class is to accumulate multiple log messages with the same log level and log category. The log messages are written to the logger when the object is destroyed. You pass the logger to this class as a 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.

Constructs the Log Record object.

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

Writes accumulated log messages to the logger.

Member Function Documentation

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

Appends a single value message to the log storage.

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

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