Interface for the loggers. More...

#include <ILogger.h>

Inherited by Stormancer::ConsoleLogger, Stormancer::FileLogger, Stormancer::NullLogger, and Stormancer::VisualStudioLogger.

Public Member Functions

virtual void log (LogLevel level, const std::string &category, const std::string &message, const std::string &data="")=0
 Logs a full message.
 
virtual void log (const std::string &message)
 Logs a simple message.
 
virtual void log (const std::exception &ex)
 Logs an exception.
 
virtual void log (LogLevel level, const std::string &category, const std::string &message, const std::exception &ex)
 Logs a full message with exception as data.
 

Static Public Member Functions

static std::string format (const std::string &name, LogLevel level, const std::string &category, const std::string &message, const std::string &data="")
 
static std::string formatException (const std::string &name, const std::exception &ex)
 

Protected Member Functions

 ILogger (const std::string &name="")
 

Protected Attributes

const std::string _name
 

Friends

class Client
 

Detailed Description

Interface for the loggers.

Member Function Documentation

◆ format()

static std::string Stormancer::ILogger::format ( const std::string &  name,
LogLevel  level,
const std::string &  category,
const std::string &  message,
const std::string &  data = "" 
)
static

A basic format of the log message.

Parameters
nameLogger name (can be empty).
levelThe log level.
categoryThe category of the log (the source).
messageThe message of the log.
dataSome additional data.
Returns
The formatted message.

◆ formatException()

static std::string Stormancer::ILogger::formatException ( const std::string &  name,
const std::exception &  ex 
)
static

A basic format of an exception.

Parameters
nameLogger name (can be empty).
exThe exception.
Returns
The formatted message.

The documentation for this class was generated from the following file:
  • stormancer/stormancer-sources/include/public/stormancer/Logger/ILogger.h