The MAUVE Toolchain
mauve::runtime::ResourceLogger Class Referencefinal

Class of a MAUVE logger for a resrouce. More...

#include <logger.hpp>

Inheritance diagram for mauve::runtime::ResourceLogger:
Collaboration diagram for mauve::runtime::ResourceLogger:

Public Member Functions

 ResourceLogger (AbstractResource *resource)
 Create a logger for a resource. More...
 
- Public Member Functions inherited from mauve::runtime::AbstractLogger
 AbstractLogger ()
 Constructor.
 
virtual ~AbstractLogger ()
 Destructor.
 
template<typename... Args>
void critical (const char *fmt, const Args &...args)
 Log a message at CRITICAL level. More...
 
template<typename... Args>
void debug (const char *fmt, const Args &...args)
 Log a message at DEBUG level. More...
 
template<typename... Args>
void error (const char *fmt, const Args &...args)
 Log a message at ERROR level. More...
 
template<typename... Args>
void info (const char *fmt, const Args &...args)
 Log a message at INFO level. More...
 
template<typename... Args>
void trace (const char *fmt, const Args &...args)
 Log a message at TRACE level. More...
 
template<typename... Args>
void warn (const char *fmt, const Args &...args)
 Log a message at WARN level. More...
 

Protected Member Functions

std::string name () override
 Get Logger category name. More...
 
std::string prepend (const char *fmt) override
 Prepend log message with contextual data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mauve::runtime::AbstractLogger
static void clear ()
 Clear all loggers information.
 
static AbstractLoggerget_logger (const std::string &name)
 Get a logger by its name. More...
 
static void initialize ()
 Initialize the logging framework with default parameters.
 
static void initialize (std::istream &is)
 Initialize the logging framework from an input stream. More...
 
static void initialize (const std::string &s)
 Initialize the logging framework from a string. More...
 
static void initialize (const YAML::Node &n)
 Initialize the logging framework from a YAML node. More...
 
- Static Protected Member Functions inherited from mauve::runtime::AbstractLogger
static spdlog::level::level_enum level_enum (const std::string &lvl)
 Convert a string to a log level. More...
 
- Static Protected Attributes inherited from mauve::runtime::AbstractLogger
static std::shared_ptr< spdlog::logger > default_logger_
 Default logger when no category specified.
 
static std::map< std::string, std::vector< std::shared_ptr< spdlog::logger > > > loggers
 Store spdlog loggers associated to the categories.
 

Detailed Description

Class of a MAUVE logger for a resrouce.

Constructor & Destructor Documentation

mauve::runtime::ResourceLogger::ResourceLogger ( AbstractResource resource)

Create a logger for a resource.

Parameters
compthe resour that logs

Member Function Documentation

std::string mauve::runtime::ResourceLogger::name ( )
overrideprotectedvirtual

Get Logger category name.

Returns
the category name attached to this logger

Implements mauve::runtime::AbstractLogger.

std::string mauve::runtime::ResourceLogger::prepend ( const char *  fmt)
overrideprotectedvirtual

Prepend log message with contextual data.

Parameters
fmtthe original message
Returns
a new message with component data

Implements mauve::runtime::AbstractLogger.