File logging.hpp๏ƒ

Define the logging utilities for nuTens.

Basically just use spdlog interface. However we define our own log levels and macros and pass them through to the logging library. This is juuust in case we ever want to change the logging library we use. This way only this file would need to change.

Defines

SPDLOG_ACTIVE_LEVEL๏ƒ
NT_TRACE(...)๏ƒ

Trace message that will only be displayed if NT_LOG_LEVEL == NT_LOG_LEVEL_TRACE.

Parameters:
  • ... โ€“ [in] The message to print. This can consist of just a simple string, or a format string and subsequent variables to format.

NT_DEBUG(...)๏ƒ

Debug message that will only be displayed if NT_LOG_LEVEL <= NT_LOG_LEVEL_DEBUG.

Parameters:
  • ... โ€“ [in] The message to print. This can consist of just a simple string, or a format string and subsequent variables to format.

NT_INFO(...)๏ƒ

Information message that will only be displayed if NT_LOG_LEVEL <= NT_LOG_LEVEL_INFO.

Parameters:
  • ... โ€“ [in] The message to print. This can consist of just a simple string, or a format string and subsequent variables to format.

NT_WARN(...)๏ƒ

Warning message that will only be displayed if NT_LOG_LEVEL <= NT_LOG_LEVEL_WARNING.

Parameters:
  • ... โ€“ [in] The message to print. This can consist of just a simple string, or a format string and subsequent variables to format.

NT_ERROR(...)๏ƒ

Error message that will only be displayed if NT_LOG_LEVEL <= NT_LOG_LEVEL_ERROR.

Parameters:
  • ... โ€“ [in] The message to print. This can consist of just a simple string, or a format string and subsequent variables to format.

Variables

constexpr size_t NT_LOG_LEVEL_TRACE = 0๏ƒ
constexpr size_t NT_LOG_LEVEL_DEBUG = 1๏ƒ
constexpr size_t NT_LOG_LEVEL_INFO = 2๏ƒ
constexpr size_t NT_LOG_LEVEL_WARNING = 3๏ƒ
constexpr size_t NT_LOG_LEVEL_ERROR = 4๏ƒ
constexpr size_t NT_LOG_LEVEL_SILENT = 5๏ƒ
static const spdlog::level::level_enum runtimeLogLevel = spdlog::level::trace๏ƒ
namespace ntlogging๏ƒ

Functions

inline void setup_logging()๏ƒ

Set up the logger at runtime, should only be invoked once the very first time any of the logging macros below are called.

Variables

static std::once_flag logLevelOnceFlag๏ƒ