AutoPas  3.0.0
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
Logger.h File Reference
#include <spdlog/fmt/bundled/ranges.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/ostream_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <iostream>
Include dependency graph for Logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  autopas::Logger
 Logger class to provide interface to basic functions of the logger. More...
 

Namespaces

namespace  autopas
 This is the main namespace of AutoPas.
 

Macros

#define AutoPasLog(lvl, fmt, ...)   AutoPasLog_##lvl(fmt, ##__VA_ARGS__)
 Macro for logging providing common meta information without filename.
 
Per-level building blocks of AutoPasLog

These mirror spdlog's own SPDLOG_LOGGER_<LEVEL> wrappers, but are gated on AUTOPAS_ACTIVE_LEVEL.

Levels below the configured one expand to (void)0, so they cost nothing at run time. The purpose of this is to allow for a consumer to keep AutoPas's log level independent of that of their own spdlog.

#define AutoPasLog_TRACE(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::trace, __VA_ARGS__)
 Logs at TRACE level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above TRACE.
 
#define AutoPasLog_DEBUG(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::debug, __VA_ARGS__)
 Logs at DEBUG level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above DEBUG.
 
#define AutoPasLog_INFO(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::info, __VA_ARGS__)
 Logs at INFO level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above INFO.
 
#define AutoPasLog_WARN(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::warn, __VA_ARGS__)
 Logs at WARN level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above WARN.
 
#define AutoPasLog_ERROR(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::err, __VA_ARGS__)
 Logs at ERROR level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above ERROR.
 
#define AutoPasLog_CRITICAL(...)   SPDLOG_LOGGER_CALL(autopas::Logger::get(), spdlog::level::critical, __VA_ARGS__)
 Logs at CRITICAL level, or expands to (void)0 if AUTOPAS_ACTIVE_LEVEL is above CRITICAL.
 

Detailed Description

Author
seckler
Date
20.04.18

Macro Definition Documentation

◆ AutoPasLog

#define AutoPasLog (   lvl,
  fmt,
  ... 
)    AutoPasLog_##lvl(fmt, ##__VA_ARGS__)

Macro for logging providing common meta information without filename.

Parameters
lvlPossible levels: TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL.
fmtMessage with formatting tokens
...Formatting arguments
Note
A ';' is enforced at the end of the macro.