Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
Logger.hpp File Reference
#include <Core/Core.hpp>
#include <spdlog/fmt/ostr.h>
#include <spdlog/spdlog.h>

Go to the source code of this file.

Classes

class  Logger
 

Macros

#define ENIGMA_LOGGER_H
 
#define ENIGMA_TRACE(...)   ::Enigma::Logger::getLogger()->trace(__VA_ARGS__)
 Enigma Log Macros. More...
 
#define ENIGMA_LOG(...)   ::Enigma::Logger::getLogger()->debug(__VA_ARGS__)
 
#define ENIGMA_INFO(...)   ::Enigma::Logger::getLogger()->info(__VA_ARGS__)
 
#define ENIGMA_WARN(...)   ::Enigma::Logger::getLogger()->warn("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)
 
#define ENIGMA_ERROR(...)   ::Enigma::Logger::getLogger()->error("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)
 
#define ENIGMA_CRITICAL(...)   ::Enigma::Logger::getLogger()->critical("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)
 
#define ENIGMA_TRACE_IF(condition, ...)    if ((condition)) ENIGMA_TRACE(__VA_ARGS__);
 
#define ENIGMA_LOG_IF(condition, ...)    if ((condition)) ENIGMA_LOG(__VA_ARGS__);
 
#define ENIGMA_INFO_IF(condition, ...)    if ((condition)) ENIGMA_INFO(__VA_ARGS__);
 
#define ENIGMA_WARN_IF(condition, ...)    if ((condition)) ENIGMA_WARN(__VA_ARGS__);
 
#define ENIGMA_ERROR_IF(condition, ...)    if ((condition)) ENIGMA_ERROR(__VA_ARGS__);
 
#define ENIGMA_CRITICAL_IF(condition, ...)    if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);
 
#define log_trace(...)   ENIGMA_TRACE(__VA_ARGS__)
 
#define log_debug(...)   ENIGMA_LOG(__VA_ARGS__)
 
#define log_info(...)   ENIGMA_INFO(__VA_ARGS__)
 
#define log_warn(...)   ENIGMA_WARN(__VA_ARGS__)
 
#define log_error(...)   ENIGMA_ERROR(__VA_ARGS__)
 
#define log_critical(...)   ENIGMA_CRITICAL(__VA_ARGS__)
 
#define log_trace_if(...)    if ((condition)) ENIGMA_TRACE(__VA_ARGS__);
 
#define log_debug_if(...)    if ((condition)) ENIGMA_LOG(__VA_ARGS__);
 
#define log_info_if(...)    if ((condition)) ENIGMA_INFO(__VA_ARGS__);
 
#define log_warn_if(...)    if ((condition)) ENIGMA_WARN(__VA_ARGS__);
 
#define log_error_if(...)    if ((condition)) ENIGMA_ERROR(__VA_ARGS__);
 
#define log_critical_if(...)    if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);
 
#define LOG_TRACE(...)   ENIGMA_TRACE(__VA_ARGS__)
 
#define LOG_DEBUG(...)   ENIGMA_LOG(__VA_ARGS__)
 
#define LOG_INFO(...)   ENIGMA_INFO(__VA_ARGS__)
 
#define LOG_WARN(...)   ENIGMA_WARN(__VA_ARGS__)
 
#define LOG_ERROR(...)   ENIGMA_ERROR(__VA_ARGS__)
 
#define LOG_CRITICAL(...)   ENIGMA_CRITICAL(__VA_ARGS__)
 
#define LOG_TRACE_IF(condition, ...)    if ((condition)) ENIGMA_TRACE(__VA_ARGS__);
 
#define LOG_LOG_IF(condition, ...)    if ((condition)) ENIGMA_LOG(__VA_ARGS__);
 
#define LOG_INFO_IF(condition, ...)    if ((condition)) ENIGMA_INFO(__VA_ARGS__);
 
#define LOG_WARN_IF(condition, ...)    if ((condition)) ENIGMA_WARN(__VA_ARGS__);
 
#define LOG_ERROR_IF(condition, ...)    if ((condition)) ENIGMA_ERROR(__VA_ARGS__);
 
#define LOG_CRITICAL_IF(condition, ...)    if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);
 

Macro Definition Documentation

◆ ENIGMA_CRITICAL

#define ENIGMA_CRITICAL (   ...)    ::Enigma::Logger::getLogger()->critical("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)

Definition at line 44 of file Logger.hpp.

◆ ENIGMA_CRITICAL_IF

#define ENIGMA_CRITICAL_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);

Definition at line 56 of file Logger.hpp.

◆ ENIGMA_ERROR

#define ENIGMA_ERROR (   ...)    ::Enigma::Logger::getLogger()->error("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)

Definition at line 43 of file Logger.hpp.

◆ ENIGMA_ERROR_IF

#define ENIGMA_ERROR_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_ERROR(__VA_ARGS__);

Definition at line 54 of file Logger.hpp.

◆ ENIGMA_INFO

#define ENIGMA_INFO (   ...)    ::Enigma::Logger::getLogger()->info(__VA_ARGS__)

Definition at line 41 of file Logger.hpp.

◆ ENIGMA_INFO_IF

#define ENIGMA_INFO_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_INFO(__VA_ARGS__);

Definition at line 50 of file Logger.hpp.

◆ ENIGMA_LOG

#define ENIGMA_LOG (   ...)    ::Enigma::Logger::getLogger()->debug(__VA_ARGS__)

Definition at line 40 of file Logger.hpp.

◆ ENIGMA_LOG_IF

#define ENIGMA_LOG_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_LOG(__VA_ARGS__);

Definition at line 48 of file Logger.hpp.

◆ ENIGMA_LOGGER_H

#define ENIGMA_LOGGER_H

Definition at line 3 of file Logger.hpp.

◆ ENIGMA_TRACE

#define ENIGMA_TRACE (   ...)    ::Enigma::Logger::getLogger()->trace(__VA_ARGS__)

Enigma Log Macros.

Definition at line 39 of file Logger.hpp.

◆ ENIGMA_TRACE_IF

#define ENIGMA_TRACE_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_TRACE(__VA_ARGS__);

Definition at line 46 of file Logger.hpp.

◆ ENIGMA_WARN

#define ENIGMA_WARN (   ...)    ::Enigma::Logger::getLogger()->warn("{}\n{}:{}\n{}", fmt::format(__VA_ARGS__), __FILE__, __LINE__, ENIGMA_CURRENT_FUNCTION)

Definition at line 42 of file Logger.hpp.

◆ ENIGMA_WARN_IF

#define ENIGMA_WARN_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_WARN(__VA_ARGS__);

Definition at line 52 of file Logger.hpp.

◆ log_critical

#define log_critical (   ...)    ENIGMA_CRITICAL(__VA_ARGS__)

Definition at line 64 of file Logger.hpp.

◆ LOG_CRITICAL

#define LOG_CRITICAL (   ...)    ENIGMA_CRITICAL(__VA_ARGS__)

Definition at line 84 of file Logger.hpp.

◆ log_critical_if

#define log_critical_if (   ...)     if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);

Definition at line 76 of file Logger.hpp.

◆ LOG_CRITICAL_IF

#define LOG_CRITICAL_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_CRITICAL(__VA_ARGS__);

Definition at line 96 of file Logger.hpp.

◆ log_debug

#define log_debug (   ...)    ENIGMA_LOG(__VA_ARGS__)

Definition at line 60 of file Logger.hpp.

◆ LOG_DEBUG

#define LOG_DEBUG (   ...)    ENIGMA_LOG(__VA_ARGS__)

Definition at line 80 of file Logger.hpp.

◆ log_debug_if

#define log_debug_if (   ...)     if ((condition)) ENIGMA_LOG(__VA_ARGS__);

Definition at line 68 of file Logger.hpp.

◆ log_error

#define log_error (   ...)    ENIGMA_ERROR(__VA_ARGS__)

Definition at line 63 of file Logger.hpp.

◆ LOG_ERROR

#define LOG_ERROR (   ...)    ENIGMA_ERROR(__VA_ARGS__)

Definition at line 83 of file Logger.hpp.

◆ log_error_if

#define log_error_if (   ...)     if ((condition)) ENIGMA_ERROR(__VA_ARGS__);

Definition at line 74 of file Logger.hpp.

◆ LOG_ERROR_IF

#define LOG_ERROR_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_ERROR(__VA_ARGS__);

Definition at line 94 of file Logger.hpp.

◆ log_info

#define log_info (   ...)    ENIGMA_INFO(__VA_ARGS__)

Definition at line 61 of file Logger.hpp.

◆ LOG_INFO

#define LOG_INFO (   ...)    ENIGMA_INFO(__VA_ARGS__)

Definition at line 81 of file Logger.hpp.

◆ log_info_if

#define log_info_if (   ...)     if ((condition)) ENIGMA_INFO(__VA_ARGS__);

Definition at line 70 of file Logger.hpp.

◆ LOG_INFO_IF

#define LOG_INFO_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_INFO(__VA_ARGS__);

Definition at line 90 of file Logger.hpp.

◆ LOG_LOG_IF

#define LOG_LOG_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_LOG(__VA_ARGS__);

Definition at line 88 of file Logger.hpp.

◆ log_trace

#define log_trace (   ...)    ENIGMA_TRACE(__VA_ARGS__)

Definition at line 59 of file Logger.hpp.

◆ LOG_TRACE

#define LOG_TRACE (   ...)    ENIGMA_TRACE(__VA_ARGS__)

Definition at line 79 of file Logger.hpp.

◆ log_trace_if

#define log_trace_if (   ...)     if ((condition)) ENIGMA_TRACE(__VA_ARGS__);

Definition at line 66 of file Logger.hpp.

◆ LOG_TRACE_IF

#define LOG_TRACE_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_TRACE(__VA_ARGS__);

Definition at line 86 of file Logger.hpp.

◆ log_warn

#define log_warn (   ...)    ENIGMA_WARN(__VA_ARGS__)

Definition at line 62 of file Logger.hpp.

◆ LOG_WARN

#define LOG_WARN (   ...)    ENIGMA_WARN(__VA_ARGS__)

Definition at line 82 of file Logger.hpp.

◆ log_warn_if

#define log_warn_if (   ...)     if ((condition)) ENIGMA_WARN(__VA_ARGS__);

Definition at line 72 of file Logger.hpp.

◆ LOG_WARN_IF

#define LOG_WARN_IF (   condition,
  ... 
)     if ((condition)) ENIGMA_WARN(__VA_ARGS__);

Definition at line 92 of file Logger.hpp.