Serenity Logger
A very fast and effiecient logging library. This library currently can log to files, rotate files when logging, log to the terminal, and is aware if the terminal is being piped during logging.
serenity Namespace Reference

This is the namespace that the entire library falls under.

Namespaces

namespace  experimental
 This namespace holds functions or features still being worked on.
 
namespace  msg_details
 This namespace holds the classes that comprise mostly everything about a log message.
 
namespace  SERENITY_LUTS
 This namespace holds the look-ups used in some of the formatting structs.
 
namespace  targets
 This namespace holds the classes in charge of where to output the log message to.
 

Classes

struct  BackgroundThread
 Struct that holds the specific variables in charge of the background flush thread in file targets. More...
 
struct  FileSettings
 Struct that holds the basic file settings for file targets. More...
 

Enumerations

enum class  LineEnd { linux = 0 , windows = 1 , mac = 2 }
 The platform-dependant line ending that should be used. More...
 
enum class  LoggerLevel {
  trace = 0 , info = 1 , debug = 2 , warning = 3 ,
  error = 4 , fatal = 5 , off = 6
}
 This enum encapsulates the logging level features and the actual logger's level. More...
 
enum class  message_time_mode { local , utc }
 The time mode that should be used for the logger target. More...
 

Functions

static std::string_view MsgLevelToShortString (LoggerLevel level)
 Used to return the short string representation of the current message level. More...
 
static std::string_view MsgLevelToString (LoggerLevel level)
 Used to return the full string representation of the current message level. More...
 

Enumeration Type Documentation

◆ LineEnd

enum class serenity::LineEnd
strong

These values are used by the line_ending unorderd map to map the enum value to the corresponding end of line to append to each log message. Both this enum and the line_ending map are used automatically via the platform detection macros when formatting the log message.

Enumerator
linux 

Used to map to line_ending value "\n".

windows 

Used to map to line_ending value "\r\n".

mac 

Used to map to line_ending value "\r".

◆ LoggerLevel

enum class serenity::LoggerLevel
strong

This enum is used in formatting, on checking if the logger should log, whether or not the logger should flush based on the level set, setting the message level, etc...

◆ message_time_mode

enum class serenity::message_time_mode
strong

This controls how the time is displayed when formatting the prepended text.

Function Documentation

◆ MsgLevelToShortString()

serenity::MsgLevelToShortString ( LoggerLevel  level)
static


Logger Level Return Value
LoggerLevel::info "I"
LoggerLevel::trace "T"
LoggerLevel::debug "D"
LoggerLevel::warning "W"
LoggerLevel::error "E"
LoggerLevel::fatal "F"


Unknown values result in an empty string returned

◆ MsgLevelToString()

serenity::MsgLevelToString ( LoggerLevel  level)
static


Logger Level Return Value
LoggerLevel::info "Info"
LoggerLevel::trace "Trace"
LoggerLevel::debug "Debug"
LoggerLevel::warning "Warn"
LoggerLevel::error "Error"
LoggerLevel::fatal "Fatal"


Unknown values result in an empty string returned