Simple-Log  alpha-v0.7
sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint > Class Template Reference

A collection of logging related information. More...

#include <Record.hpp>

Public Types

using Message_t = std::remove_cvref_t< TMessage >
 
using SeverityLevel_t = std::remove_cvref_t< TSeverityLevel >
 
using Channel_t = std::remove_cvref_t< TChannel >
 
using TimePoint_t = std::remove_cvref_t< TTimePoint >
 

Public Member Functions

const Message_tmessage () const noexcept
 Const access to the message. More...
 
template<std::convertible_to< Message_t > UMessage>
void setMessage (UMessage &&msg)
 Sets the message string. More...
 
const TimePoint_ttimePoint () const noexcept
 Const access to the time stamp. More...
 
template<std::convertible_to< TimePoint_t > UTimePoint>
void setTimePoint (UTimePoint &&timePoint)
 Sets the Record s time stamp. More...
 
const SeverityLevel_tseverity () const noexcept
 Const access to the severity level. More...
 
template<std::convertible_to< SeverityLevel_t > USeverityLevel>
void setSeverity (USeverityLevel &&severity)
 Sets the Record s severity level. More...
 
const Channel_tchannel () const noexcept
 Const access to the channel. More...
 
template<std::convertible_to< Channel_t > UChannel>
void setChannel (UChannel &&channel)
 Sets the Record s severity level. More...
 

Detailed Description

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
TSeverityLevelSeverity level type
TChannelChannel descriptor type
TMessageString type for storing messages
TTimePointType 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.

Member Typedef Documentation

◆ Channel_t

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
using sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::Channel_t = std::remove_cvref_t<TChannel>

◆ Message_t

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
using sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::Message_t = std::remove_cvref_t<TMessage>

◆ SeverityLevel_t

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
using sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::SeverityLevel_t = std::remove_cvref_t<TSeverityLevel>

◆ TimePoint_t

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
using sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::TimePoint_t = std::remove_cvref_t<TTimePoint>

Member Function Documentation

◆ channel()

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
const Channel_t& sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::channel ( ) const
inlinenoexcept

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 Message_t& sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::message ( ) const
inlinenoexcept

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
UChannelType which must be convertible to Channel_t
Parameters
channelchannel 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
UMessageType which must be convertible to Message_t
Parameters
msgMessage content

◆ 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
USeverityLevelType which must be convertible to SeverityLevel_t
Parameters
severityA time point

◆ 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
UTimePointType which must be convertible to TimePoint_t
Parameters
timePointA time point

◆ severity()

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
const SeverityLevel_t& sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::severity ( ) const
inlinenoexcept

Const access to the severity level.

Returns
Returns a const ref
Examples
ColorizedConsoleLogging/main.cpp.

◆ timePoint()

template<std::semiregular TSeverityLevel, std::semiregular TChannel, std::semiregular TMessage = std::string, std::semiregular TTimePoint = std::chrono::system_clock::time_point>
const TimePoint_t& sl::log::BaseRecord< TSeverityLevel, TChannel, TMessage, TTimePoint >::timePoint ( ) const
inlinenoexcept

Const access to the time stamp.

Returns
Returns a const ref

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