OmniSketch  0.1
Oh my sketch!
logger.cpp File Reference

Implementation of the logger. More...

#include <common/logger.h>
#include <fmt/color.h>
#include <fmt/core.h>
Include dependency graph for logger.cpp:

Functions

void Log (LogLevel level, const std::string &msg, const std::string &file, int lineno)
 Workhorse of logging. More...
 

Detailed Description

Implementation of the logger.

Author
FerricIon (you@d.nosp@m.omai.nosp@m.n.com)

Function Documentation

◆ Log()

void Log ( LogLevel  level,
const std::string &  msg,
const std::string &  file,
int  lineno 
)

Workhorse of logging.

The log shows not only its content and level, but the file and the line where it was generated as well.

Parameters
levellevel of the log, namely
  • VERBOSE
  • INFO
  • WARNING
  • ERROR
  • FATAL
  • UNKNOWN

These names are quite self-explanatory.

Parameters
msgcontent of the message
filethe file from which the log is generated
linenothe line at which the log is generated
Warning
Never call this function directly. Rather, use the LOG macro as follows.
std::string msg = "This is an INFO";
LOG(INFO, msg);
INFO
@ INFO
informing messages
Definition: logger.h:15
LOG
#define LOG(level, msg)
Definition: logger.h:22