SILICON
Loading...
Searching...
No Matches
Logger Class Reference

#include <logger.hpp>

Public Types

using SinkHandle = std::size_t
using CallbackSink = std::function<void(const LogMessage&)>

Public Member Functions

 Logger (std::string category)
void trace (std::string_view message) const
void debug (std::string_view message) const
void info (std::string_view message) const
void warning (std::string_view message) const
void error (std::string_view message) const
void critical (std::string_view message) const

Static Public Member Functions

static void initialize ()
static void shutdown ()
static void addConsoleSink (std::ostream &stream)
static void setMinimumLevel (LogLevel level)
static SinkHandle addCallbackSink (CallbackSink callback)
static void removeSink (SinkHandle handle)
static void trace (std::string_view category, std::string_view message)
static void debug (std::string_view category, std::string_view message)
static void info (std::string_view category, std::string_view message)
static void warning (std::string_view category, std::string_view message)
static void error (std::string_view category, std::string_view message)
static void critical (std::string_view category, std::string_view message)

Static Private Member Functions

static void log (LogLevel level, std::string_view category, std::string_view message)

Private Attributes

std::string category

Detailed Description

Definition at line 26 of file logger.hpp.

Member Typedef Documentation

◆ CallbackSink

using CallbackSink = std::function<void(const LogMessage&)>

Definition at line 29 of file logger.hpp.

◆ SinkHandle

using SinkHandle = std::size_t

Definition at line 28 of file logger.hpp.

Constructor & Destructor Documentation

◆ Logger()

Logger ( std::string category)
explicit

Definition at line 178 of file logger.cpp.

Member Function Documentation

◆ addCallbackSink()

Logger::SinkHandle addCallbackSink ( CallbackSink callback)
static

Definition at line 240 of file logger.cpp.

◆ addConsoleSink()

void addConsoleSink ( std::ostream & stream)
static

Definition at line 208 of file logger.cpp.

◆ critical() [1/2]

void critical ( std::string_view category,
std::string_view message )
static

Definition at line 297 of file logger.cpp.

◆ critical() [2/2]

void critical ( std::string_view message) const

Definition at line 327 of file logger.cpp.

◆ debug() [1/2]

void debug ( std::string_view category,
std::string_view message )
static

Definition at line 277 of file logger.cpp.

◆ debug() [2/2]

void debug ( std::string_view message) const

Definition at line 307 of file logger.cpp.

◆ error() [1/2]

void error ( std::string_view category,
std::string_view message )
static

Definition at line 292 of file logger.cpp.

◆ error() [2/2]

void error ( std::string_view message) const

Definition at line 322 of file logger.cpp.

◆ info() [1/2]

void info ( std::string_view category,
std::string_view message )
static

Definition at line 282 of file logger.cpp.

◆ info() [2/2]

void info ( std::string_view message) const

Definition at line 312 of file logger.cpp.

◆ initialize()

void initialize ( )
static

Definition at line 180 of file logger.cpp.

◆ log()

void log ( LogLevel level,
std::string_view category,
std::string_view message )
staticprivate

Definition at line 332 of file logger.cpp.

◆ removeSink()

void removeSink ( SinkHandle handle)
static

Definition at line 258 of file logger.cpp.

◆ setMinimumLevel()

void setMinimumLevel ( LogLevel level)
static

Definition at line 231 of file logger.cpp.

◆ shutdown()

void shutdown ( )
static

Definition at line 187 of file logger.cpp.

◆ trace() [1/2]

void trace ( std::string_view category,
std::string_view message )
static

Definition at line 272 of file logger.cpp.

◆ trace() [2/2]

void trace ( std::string_view message) const

Definition at line 302 of file logger.cpp.

◆ warning() [1/2]

void warning ( std::string_view category,
std::string_view message )
static

Definition at line 287 of file logger.cpp.

◆ warning() [2/2]

void warning ( std::string_view message) const

Definition at line 317 of file logger.cpp.

Member Data Documentation

◆ category

std::string category
private

Definition at line 55 of file logger.hpp.


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