DotNameLib
Loading...
Searching...
No Matches
dotnamecpp::logging::ILogger Class Referenceabstract

#include <ILogger.hpp>

Inheritance diagram for dotnamecpp::logging::ILogger:
Collaboration diagram for dotnamecpp::logging::ILogger:

Public Member Functions

 ILogger ()=default
virtual ~ILogger ()=default
virtual void debug (const std::string &message, const std::string &caller="")=0
 Log a debug message.
virtual void info (const std::string &message, const std::string &caller="")=0
 Log an info message.
virtual void warning (const std::string &message, const std::string &caller="")=0
 Log a warning message.
virtual void error (const std::string &message, const std::string &caller="")=0
 Log an error message.
virtual void critical (const std::string &message, const std::string &caller="")=0
 Log a critical message.
virtual void setLevel (Level level)=0
 Set the Level object.
virtual Level getLevel () const =0
 Get the Level object.
virtual void setAppPrefix (const std::string &prefix)=0
 Set the application prefix for log messages.
virtual std::string getAppPrefix () const =0
 Get the App Prefix object.
virtual bool enableFileLogging (const std::string &filename)=0
 Enable logging to a file.
virtual void disableFileLogging ()=0
 Disable logging to a file.
LogStream stream (Level level, const std::string &caller="")
 Create a LogStream for streaming log messages.
LogStream debugStream (const std::string &caller="")
 Create a LogStream for streaming debug messages.
LogStream infoStream (const std::string &caller="")
 Create a LogStream for streaming info messages.
LogStream warningStream (const std::string &caller="")
 Create a LogStream for streaming warning messages.
LogStream errorStream (const std::string &caller="")
 Create a LogStream for streaming error messages.
LogStream criticalStream (const std::string &caller="")
 Create a LogStream for streaming critical messages.
template<typename... Args>
void debugFmt (const std::string &format, Args &&...args)
 Create a formatted debug message.
template<typename... Args>
void infoFmt (const std::string &format, Args &&...args)
 Create a formatted info message.
template<typename... Args>
void warningFmt (const std::string &format, Args &&...args)
 Create a formatted warning message.
template<typename... Args>
void errorFmt (const std::string &format, Args &&...args)
 Create a formatted error message.
template<typename... Args>
void criticalFmt (const std::string &format, Args &&...args)
 Create a formatted critical message.

Constructor & Destructor Documentation

◆ ILogger()

dotnamecpp::logging::ILogger::ILogger ( )
default

◆ ~ILogger()

virtual dotnamecpp::logging::ILogger::~ILogger ( )
virtualdefault

Member Function Documentation

◆ critical()

virtual void dotnamecpp::logging::ILogger::critical ( const std::string & message,
const std::string & caller = "" )
pure virtual

Log a critical message.

Parameters
message
caller

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

Here is the caller graph for this function:

◆ criticalFmt()

template<typename... Args>
void dotnamecpp::logging::ILogger::criticalFmt ( const std::string & format,
Args &&... args )
inline

Create a formatted critical message.

Template Parameters
Args
Parameters
format
args
Here is the call graph for this function:

◆ criticalStream()

LogStream dotnamecpp::logging::ILogger::criticalStream ( const std::string & caller = "")
inline

Create a LogStream for streaming critical messages.

Parameters
caller
Returns
LogStream
Here is the call graph for this function:

◆ debug()

virtual void dotnamecpp::logging::ILogger::debug ( const std::string & message,
const std::string & caller = "" )
pure virtual

Log a debug message.

Parameters
message
caller

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

Here is the caller graph for this function:

◆ debugFmt()

template<typename... Args>
void dotnamecpp::logging::ILogger::debugFmt ( const std::string & format,
Args &&... args )
inline

Create a formatted debug message.

Template Parameters
Args
Parameters
format
args
Here is the call graph for this function:

◆ debugStream()

LogStream dotnamecpp::logging::ILogger::debugStream ( const std::string & caller = "")
inline

Create a LogStream for streaming debug messages.

Parameters
caller
Returns
LogStream
Here is the call graph for this function:

◆ disableFileLogging()

virtual void dotnamecpp::logging::ILogger::disableFileLogging ( )
pure virtual

Disable logging to a file.

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ enableFileLogging()

virtual bool dotnamecpp::logging::ILogger::enableFileLogging ( const std::string & filename)
pure virtual

Enable logging to a file.

Parameters
filename
Returns
true
false

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ error()

virtual void dotnamecpp::logging::ILogger::error ( const std::string & message,
const std::string & caller = "" )
pure virtual

Log an error message.

Parameters
message
caller

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

Here is the caller graph for this function:

◆ errorFmt()

template<typename... Args>
void dotnamecpp::logging::ILogger::errorFmt ( const std::string & format,
Args &&... args )
inline

Create a formatted error message.

Template Parameters
Args
Parameters
format
args
Here is the call graph for this function:

◆ errorStream()

LogStream dotnamecpp::logging::ILogger::errorStream ( const std::string & caller = "")
inline

Create a LogStream for streaming error messages.

Parameters
caller
Returns
LogStream
Here is the call graph for this function:

◆ getAppPrefix()

virtual std::string dotnamecpp::logging::ILogger::getAppPrefix ( ) const
pure virtual

Get the App Prefix object.

Returns
std::string

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ getLevel()

virtual Level dotnamecpp::logging::ILogger::getLevel ( ) const
nodiscardpure virtual

Get the Level object.

Returns
Level

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ info()

virtual void dotnamecpp::logging::ILogger::info ( const std::string & message,
const std::string & caller = "" )
pure virtual

Log an info message.

Parameters
message
caller

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

Here is the caller graph for this function:

◆ infoFmt()

template<typename... Args>
void dotnamecpp::logging::ILogger::infoFmt ( const std::string & format,
Args &&... args )
inline

Create a formatted info message.

Template Parameters
Args
Parameters
format
args
Here is the call graph for this function:

◆ infoStream()

LogStream dotnamecpp::logging::ILogger::infoStream ( const std::string & caller = "")
inline

Create a LogStream for streaming info messages.

Parameters
caller
Returns
LogStream
Here is the call graph for this function:

◆ setAppPrefix()

virtual void dotnamecpp::logging::ILogger::setAppPrefix ( const std::string & prefix)
pure virtual

Set the application prefix for log messages.

Parameters
prefix

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ setLevel()

virtual void dotnamecpp::logging::ILogger::setLevel ( Level level)
pure virtual

Set the Level object.

Parameters
level

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

◆ stream()

LogStream dotnamecpp::logging::ILogger::stream ( Level level,
const std::string & caller = "" )
inline

Create a LogStream for streaming log messages.

Parameters
level
caller
Returns
LogStream
Here is the caller graph for this function:

◆ warning()

virtual void dotnamecpp::logging::ILogger::warning ( const std::string & message,
const std::string & caller = "" )
pure virtual

Log a warning message.

Parameters
message
caller

Implemented in ConsoleLogger, and dotnamecpp::logging::NullLogger.

Here is the caller graph for this function:

◆ warningFmt()

template<typename... Args>
void dotnamecpp::logging::ILogger::warningFmt ( const std::string & format,
Args &&... args )
inline

Create a formatted warning message.

Template Parameters
Args
Parameters
format
args
Here is the call graph for this function:

◆ warningStream()

LogStream dotnamecpp::logging::ILogger::warningStream ( const std::string & caller = "")
inline

Create a LogStream for streaming warning messages.

Parameters
caller
Returns
LogStream
Here is the call graph for this function:

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