A collection of logging related information.
More...
#include <Record.hpp>
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
class sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >
A collection of logging related information.
- Template Parameters
-
TSeverityLevel | Severity level type |
TChannel | Channel descriptor type |
TMessage | String type for storing messages |
TTimePoint | Type for storing time related information |
This class serves as a simple collection of gathered information during a logging action. It is a basic implementation of the Record concept and users are free to use this class as a starting point for creating expanded sub-classes or even create their own right from scratch.
- Examples
- CustomRecordType/main.cpp, and CustomizeBaseRecord/main.cpp.
◆ Channel_t
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
◆ Message_t
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
◆ SeverityLevel_t
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
◆ TimePoint_t
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
◆ channel()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
Const access to the channel.
- Returns
- Returns a const ref
◆ message()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
Const access to the message.
- Returns
- Returns the stored message
◆ setChannel()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
template<std::convertible_to< Channel_t > UChannel>
void sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::setChannel |
( |
UChannel && |
channel | ) |
|
|
inline |
Sets the Record s severity level.
- Template Parameters
-
UChannel | Type which must be convertible to Channel_t |
- Parameters
-
channel | channel descriptor |
◆ setMessage()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
template<std::convertible_to< Message_t > UMessage>
void sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::setMessage |
( |
UMessage && |
msg | ) |
|
|
inline |
Sets the message string.
- Template Parameters
-
UMessage | Type which must be convertible to Message_t |
- Parameters
-
◆ setSeverity()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
template<std::convertible_to< SeverityLevel_t > USeverityLevel>
void sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::setSeverity |
( |
USeverityLevel && |
severity | ) |
|
|
inline |
Sets the Record s severity level.
- Template Parameters
-
USeverityLevel | Type which must be convertible to SeverityLevel_t |
- Parameters
-
◆ setTimePoint()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
template<std::convertible_to< TimePoint_t > UTimePoint>
void sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::setTimePoint |
( |
UTimePoint && |
timePoint | ) |
|
|
inline |
Sets the Record s time stamp.
- Template Parameters
-
UTimePoint | Type which must be convertible to TimePoint_t |
- Parameters
-
◆ severity()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
◆ timePoint()
template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
Const access to the time stamp.
- Returns
- Returns a const ref
The documentation for this class was generated from the following file: