Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::record::Logger Class Reference

Logger class. More...

#include <Logger.h>

Inheritance diagram for sese::record::Logger:
sese::record::AsyncLogger

Classes

struct  PatternAndLocation
 

Public Types

typedef std::shared_ptr< LoggerPtr
 

Public Member Functions

 Logger () noexcept
 
virtual ~Logger () noexcept=default
 
void addAppender (const AbstractAppender::Ptr &appender) noexcept
 
void removeAppender (const AbstractAppender::Ptr &appender) noexcept
 
virtual void log (const Event::Ptr &event) noexcept
 
virtual void dump (const void *buffer, size_t length) noexcept
 

Static Public Member Functions

template<typename... ARGS>
static void debug (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void debug (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void info (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void info (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void warn (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void warn (PatternAndLocation pattern_and_location)
 
template<typename... ARGS>
static void error (PatternAndLocation pattern_and_location, ARGS &&...args)
 
static void error (PatternAndLocation pattern_and_location)
 
static void addGlobalLoggerAppender (const AbstractAppender::Ptr &appender) noexcept
 
static void removeGlobalLoggerAppender (const AbstractAppender::Ptr &appender) noexcept
 

Protected Attributes

std::shared_ptr< AbstractFormatterformatter
 
std::shared_ptr< ConsoleAppenderbuiltInAppender
 
std::vector< AbstractAppender::PtrappenderVector
 

Static Private Member Functions

static void prelog (PatternAndLocation &pattern_and_location, Level level, const std::string &string) noexcept
 

Detailed Description

Logger class.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Logger> sese::record::Logger::Ptr

Constructor & Destructor Documentation

◆ Logger()

sese::record::Logger::Logger ( )
noexcept

◆ ~Logger()

virtual sese::record::Logger::~Logger ( )
virtualdefaultnoexcept

Member Function Documentation

◆ addAppender()

void sese::record::Logger::addAppender ( const AbstractAppender::Ptr & appender)
noexcept

Add log appender

Parameters
appenderLog appender

Referenced by addGlobalLoggerAppender().

◆ addGlobalLoggerAppender()

void sese::record::Logger::addGlobalLoggerAppender ( const AbstractAppender::Ptr & appender)
staticnoexcept

Add log appender to global logger

Parameters
appenderLog appender

References addAppender(), and sese::record::logger.

◆ debug() [1/2]

void sese::record::Logger::debug ( PatternAndLocation pattern_and_location)
static

◆ debug() [2/2]

template<typename... ARGS>
void sese::record::Logger::debug ( PatternAndLocation pattern_and_location,
ARGS &&... args )
static

◆ dump()

void sese::record::Logger::dump ( const void * buffer,
size_t length )
virtualnoexcept

Output raw content

Parameters
bufferBuffer
lengthLength of buffer

Reimplemented in sese::record::AsyncLogger.

Referenced by sese::Exception::printStacktrace().

◆ error() [1/2]

void sese::record::Logger::error ( PatternAndLocation pattern_and_location)
static

◆ error() [2/2]

template<typename... ARGS>
void sese::record::Logger::error ( PatternAndLocation pattern_and_location,
ARGS &&... args )
static

◆ info() [1/2]

void sese::record::Logger::info ( PatternAndLocation pattern_and_location)
static

◆ info() [2/2]

template<typename... ARGS>
void sese::record::Logger::info ( PatternAndLocation pattern_and_location,
ARGS &&... args )
static

◆ log()

◆ prelog()

void sese::record::Logger::prelog ( PatternAndLocation & pattern_and_location,
Level level,
const std::string & string )
staticprivatenoexcept

◆ removeAppender()

void sese::record::Logger::removeAppender ( const AbstractAppender::Ptr & appender)
noexcept

Remove log appender

Parameters
appenderLog appender

Referenced by removeGlobalLoggerAppender().

◆ removeGlobalLoggerAppender()

void sese::record::Logger::removeGlobalLoggerAppender ( const AbstractAppender::Ptr & appender)
staticnoexcept

Remove log appender from global logger

Parameters
appenderLog appender

References sese::record::logger, and removeAppender().

◆ warn() [1/2]

void sese::record::Logger::warn ( PatternAndLocation pattern_and_location)
static

◆ warn() [2/2]

template<typename... ARGS>
void sese::record::Logger::warn ( PatternAndLocation pattern_and_location,
ARGS &&... args )
static

Member Data Documentation

◆ appenderVector

std::vector<AbstractAppender::Ptr> sese::record::Logger::appenderVector
protected

◆ builtInAppender

std::shared_ptr<ConsoleAppender> sese::record::Logger::builtInAppender
protected

◆ formatter

std::shared_ptr<AbstractFormatter> sese::record::Logger::formatter
protected

Referenced by Logger().


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