SNode.C
Loading...
Searching...
No Matches
logger Namespace Reference

Classes

class  Logger
class  LogMessage

Enumerations

enum class  Level {
  TRACE , DEBUG , INFO , WARNING ,
  ERROR , FATAL , VERBOSE
}

Functions

static void emitLine (Level level, std::string message, const bool withErrno, const int errnoValue)

Enumeration Type Documentation

◆ Level

enum class logger::Level
strong
Enumerator
TRACE 
DEBUG 
INFO 
WARNING 
ERROR 
FATAL 
VERBOSE 

Definition at line 90 of file Logger.h.

Function Documentation

◆ emitLine()

void logger::emitLine ( Level level,
std::string message,
const bool withErrno,
const int errnoValue )
static

Definition at line 256 of file Logger.cpp.

256 {
257 if (!shouldEmit(level)) {
258 return;
259 }
260
261 if (withErrno) {
262 message += ": ";
263 message += std::strerror(errnoValue);
264 }
265
266 if (level != Level::VERBOSE) {
267 message = colorizeLevel(level) + " " + message;
268 }
269
270 if (!quietMode && stdoutLogger) {
271 stdoutLogger->log(spdlog::level::info, message);
272 }
273 if (fileLogger) {
274 fileLogger->log(spdlog::level::info, message);
275 }
276 }
std::string colorizeLevel(const logger::Level level)
Definition Logger.cpp:156
std::shared_ptr< spdlog::logger > stdoutLogger
Definition Logger.cpp:62
std::shared_ptr< spdlog::logger > fileLogger
Definition Logger.cpp:63

References anonymous_namespace{Logger.cpp}::colorizeLevel(), anonymous_namespace{Logger.cpp}::fileLogger, anonymous_namespace{Logger.cpp}::quietMode, anonymous_namespace{Logger.cpp}::shouldEmit(), anonymous_namespace{Logger.cpp}::stdoutLogger, and VERBOSE.

Referenced by logger::LogMessage::~LogMessage().

Here is the call graph for this function:
Here is the caller graph for this function: