Class endstone::Logger¶
Logger class which can format and output varies levels of logs.
#include <endstone/logger.h>
Public Types¶
Type | Name |
---|---|
enum std::uint8_t | Level Specifies the log level. |
Public Functions¶
Type | Name |
---|---|
Logger () = default |
|
void | critical (const std::string & message) const |
void | critical (const fmt::format_string< Args... > format, Args &&... args) const |
void | debug (const std::string & message) const |
void | debug (const fmt::format_string< Args... > format, Args &&... args) const |
void | error (const std::string & message) const |
void | error (const fmt::format_string< Args... > format, Args &&... args) const |
void | error (const endstone::Error & error) const |
virtual std::string_view | getName () const = 0 Get the name of this Logger instance. |
void | info (const std::string & message) const |
void | info (const fmt::format_string< Args... > format, Args &&... args) const |
virtual bool | isEnabledFor (Level level) const = 0 Check if the Logger instance is enabled for the given logLevel . |
virtual void | log (Level level, const std::string & message) const = 0 Log a message at the given level. |
void | log (Level level, const fmt::format_string< Args... > format, Args &&... args) const |
virtual void | setLevel (Level level) = 0 Set the logging level for this Logger instance. |
void | trace (const std::string & message) const |
void | trace (const fmt::format_string< Args... > format, Args &&... args) const |
void | warning (const std::string & message) const |
void | warning (const fmt::format_string< Args... > format, Args &&... args) const |
virtual | ~Logger () = default |
Public Types Documentation¶
enum Level¶
enum endstone::Logger::Level {
Trace = 0,
Debug = 1,
Info = 2,
Warning = 3,
Error = 4,
Critical = 5,
Off = 6
};
Public Functions Documentation¶
function Logger¶
function critical [½]¶
function critical [2/2]¶
template<typename... Args>
inline void endstone::Logger::critical (
const fmt::format_string< Args... > format,
Args &&... args
) const
function debug [½]¶
function debug [2/2]¶
template<typename... Args>
inline void endstone::Logger::debug (
const fmt::format_string< Args... > format,
Args &&... args
) const
function error [⅓]¶
function error [⅔]¶
template<typename... Args>
inline void endstone::Logger::error (
const fmt::format_string< Args... > format,
Args &&... args
) const
function error [3/3]¶
function getName¶
Get the name of this Logger instance.
Returns:
The name of this Logger instance.
function info [½]¶
function info [2/2]¶
template<typename... Args>
inline void endstone::Logger::info (
const fmt::format_string< Args... > format,
Args &&... args
) const
function isEnabledFor¶
Check if the Logger instance is enabled for the given logLevel .
Parameters:
level
The log level to check
Returns:
true if the logger is enabled for the Level, false otherwise.
function log [½]¶
Log a message at the given level.
Parameters:
level
The level at which the message should be logged.message
The message to log.
function log [2/2]¶
template<typename... Args>
inline void endstone::Logger::log (
Level level,
const fmt::format_string< Args... > format,
Args &&... args
) const
function setLevel¶
Set the logging level for this Logger instance.
Parameters:
level
The desired log level
function trace [½]¶
function trace [2/2]¶
template<typename... Args>
inline void endstone::Logger::trace (
const fmt::format_string< Args... > format,
Args &&... args
) const
function warning [½]¶
function warning [2/2]¶
template<typename... Args>
inline void endstone::Logger::warning (
const fmt::format_string< Args... > format,
Args &&... args
) const
function ~Logger¶
The documentation for this class was generated from the following file include/endstone/logger.h