Public Member Functions | Protected Attributes | List of all members
logger_interface Class Referenceabstract

Abstract interface for logging strings. More...

#include <logger.hpp>

Public Member Functions

 logger_interface (logger_interface const &)=delete
logger_interfaceoperator= (logger_interface const &)=delete
virtual void do_log (logmsg::type t, std::wstring &&msg)=0
 The one thing you need to override.
template<typename String , typename... Args>
void log (logmsg::type t, String &&fmt, Args &&...args)
 The. More...
template<typename String >
void log_raw (logmsg::type t, String &&msg)
 Logs the raw string, it is not treated as format string.
bool should_log (logmsg::type t) const
void set_all (logmsg::type t)
 Sets which message types should be logged.
void set (logmsg::type t, bool flag)
 Sets whether the given types should be logged.
void enable (logmsg::type t)
 Enables logging for the passed message types.
void disable (logmsg::type t)
 Disables logging for the passed message types.

Protected Attributes

std::atomic< uint64_t > level_ {logmsg::status | logmsg::error | logmsg::command | logmsg::reply}

Detailed Description

Abstract interface for logging strings.

Each log message has a type. Logging can be enabled or disabled for each type.

The actual string to log gets assembled from the format string and its arguments only if the type is supposed to be logged.

Member Function Documentation

◆ log()

void log ( logmsg::type  t,
String &&  fmt,
Args &&...  args 


  • fmt argument is a format string suitable for fz::sprintf

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