![]() |
Iguana 1.0.0
Implementation Guardian of Analysis Algorithms
|
#include <Logger.h>
Simple logger service.
Public Types | |
| enum | Level { trace , debug , info , quiet , warn , error , silent } |
Public Member Functions | |
| template<typename... VALUES> | |
| void | Debug (std::string_view message, const VALUES... vals) const |
| Printout a log message at the debug level. | |
| void | DisableStyle () |
| Disable styled log printout color and emphasis. | |
| void | EnableStyle () |
| Enable styled log printouts, with color and emphasis. | |
| template<typename... VALUES> | |
| void | Error (std::string_view message, const VALUES... vals) const |
| Printout a log message at the error level. | |
| Level | GetLevel () |
| template<typename... VALUES> | |
| void | Info (std::string_view message, const VALUES... vals) const |
| Printout a log message at the info level. | |
| Logger (std::string_view name="log", Level const lev=DEFAULT_LEVEL, bool const enable_style=true) | |
| template<typename... VALUES> | |
| void | Print (Level const lev, std::string_view message, const VALUES... vals) const |
| void | SetLevel (Level const lev) |
| void | SetLevel (std::string_view lev) |
| template<typename... VALUES> | |
| void | Trace (std::string_view message, const VALUES... vals) const |
| Printout a log message at the trace level. | |
| template<typename... VALUES> | |
| void | Warn (std::string_view message, const VALUES... vals) const |
| Printout a log message at the warn level. | |
Static Public Member Functions | |
| static std::string | Header (std::string_view message, int const width=50) |
Static Public Attributes | |
| static Level const | DEFAULT_LEVEL = info |
| The default log level. | |
Friends | |
| class | Object |
These are the available log levels, from lowest to highest:
| iguana::Logger::Logger | ( | std::string_view | name = "log", |
| Level const | lev = DEFAULT_LEVEL, | ||
| bool const | enable_style = true ) |
| name | the name of this logger instance, which will be include in all of its printouts |
| lev | the log level |
| enable_style | if true, certain printouts will be styled with color and emphasis |
|
inline |
Printout a log message at the debug level.
|
inline |
Printout a log message at the error level.
| Level iguana::Logger::GetLevel | ( | ) |
Get the current log level
|
static |
Generate a header for a printout
| message | the header message |
| width | the width of the header in number of characters |
|
inline |
Printout a log message at the info level.
|
inline |
Printout a log message at the specified level. The message will only print if lev is at least as high as the current level of this Logger instance, as set by Logger::SetLevel.
| lev | the log level for this message |
| message | the message to print; this may be a format string, as in fmt::format |
| vals | values for the format string message |
| void iguana::Logger::SetLevel | ( | Level const | lev | ) |
Set the log level to this level. Log messages with a lower level will not be printed.
| lev | the log level |
| void iguana::Logger::SetLevel | ( | std::string_view | lev | ) |
Set the log level to this level. Log messages with a lower level will not be printed.
| lev | the log level name |
|
inline |
Printout a log message at the trace level.
|
inline |
Printout a log message at the warn level.
|
static |