Hermes
Logging

Files

file  console_colors.h
 Set of 256-terminal supported color codes.
 
file  logging.h
 Logging functions.
 
file  memory_dump.h
 

Macros

#define INFO_ENABLED
 
#define HERMES_PING   hermes::Log::info("[{}][{}][{}]", __FILE__, __LINE__, __FUNCTION__);
 Logs into info stream code location.
 
#define HERMES_LOG(FMT, ...)
 Logs into info log stream. More...
 
#define HERMES_LOG_WARNING(FMT, ...)
 Logs into warning log stream. More...
 
#define HERMES_LOG_ERROR(FMT, ...)
 Logs into error log stream. More...
 
#define HERMES_LOG_CRITICAL(FMT, ...)
 Logs into critical log stream. More...
 
#define HERMES_LOG_VARIABLE(A)
 Logs variable name and value into info log stream. More...
 
#define HERMES_LOG_ARRAY(A)
 Logs array elements into info log stream. More...
 
#define HERMES_LOG_VARIABLES(...)    hermes::Log::info("[{}][{}][{}]: {}", __FILE__, __LINE__, __FUNCTION__, hermes_log_variables(__VA_ARGS__))
 Logs multiple variables into info log stream. More...
 
#define HERMES_C_LOG(FMT, ...)
 Logs into stdout in printf style. More...
 
#define HERMES_C_LOG_ERROR(FMT, ...)
 Logs into stderr in printf style. More...
 
#define HERMES_C_DEVICE_LOG(FMT, ...)
 Logs into info stdout from device code. More...
 
#define HERMES_C_DEVICE_ERROR(FMT, ...)
 Logs into stderr from device code. More...
 

Detailed Description

Macro Definition Documentation

◆ HERMES_C_DEVICE_ERROR

#define HERMES_C_DEVICE_ERROR (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
printf("[%s][%d][%s]: ", __FILE__, __LINE__, __FUNCTION__); \
printf(FMT __VA_OPT__(,) __VA_ARGS__); \
printf("\n")

Logs into stderr from device code.

HERMES_C_LOG("my log with %d as value", 3) // produces "my log with 3 as value"
HERMES_C_LOG("simple log")
#define HERMES_C_LOG(FMT,...)
Logs into stdout in printf style.
Definition: logging.h:467
Parameters
FMTstring format following printf format
...format values

◆ HERMES_C_DEVICE_LOG

#define HERMES_C_DEVICE_LOG (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
printf("[%s][%d][%s]: ", __FILE__, __LINE__, __FUNCTION__); \
printf(FMT __VA_OPT__(,) __VA_ARGS__); \
printf("\n")

Logs into info stdout from device code.

HERMES_C_LOG("my log with %d as value", 3) // produces "my log with 3 as value"
HERMES_C_LOG("simple log")
Parameters
FMTstring format following printf format
...format values

◆ HERMES_C_LOG

#define HERMES_C_LOG (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
fprintf(stdout, "[%s][%d][%s]: ", __FILE__, __LINE__, __FUNCTION__); \
fprintf(stdout, FMT __VA_OPT__(,) __VA_ARGS__); \
fprintf(stdout, "\n")

Logs into stdout in printf style.

HERMES_C_LOG("my log with %d as value", 3) // produces "my log with 3 as value"
HERMES_C_LOG("simple log")
Parameters
FMTstring format following printf format
...format values

◆ HERMES_C_LOG_ERROR

#define HERMES_C_LOG_ERROR (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
fprintf(stderr, "[%s][%d][%s]: ", __FILE__, __LINE__, __FUNCTION__); \
fprintf(stderr, FMT __VA_OPT__(,) __VA_ARGS__); \
fprintf(stderr, "\n")

Logs into stderr in printf style.

HERMES_C_LOG_ERROR("my log with %d as value", 3) // produces "my log with 3 as value"
HERMES_C_LOG_ERROR("simple log")
#define HERMES_C_LOG_ERROR(FMT,...)
Logs into stderr in printf style.
Definition: logging.h:480
Parameters
FMTstring format following printf format
...format values

◆ HERMES_LOG

#define HERMES_LOG (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
hermes::Log::logMessage(hermes::logging_options::info, FMT, \
hermes::Log::Location{__FILE__, __LINE__, __FUNCTION__} __VA_OPT__(,) __VA_ARGS__)
static HERMES_DEVICE_CALLABLE void logMessage(logging_options message_options, const char *fmt, Location location, Ts &&...args)
Logs a formatted message with code location information.
Definition: logging.h:80
Holds information about log code location.
Definition: logging.h:67

Logs into info log stream.

HERMES_LOG("my log with {} as value", 3) // produces "my log with 3 as value"
HERMES_LOG("simple log")
#define HERMES_LOG(FMT,...)
Logs into info log stream.
Definition: logging.h:363
Parameters
FMTa const char* following hermes format (use "{}" to place each value in the string)
...format values

◆ HERMES_LOG_ARRAY

#define HERMES_LOG_ARRAY (   A)

#include <hermes/logging/logging.h>

Value:
HERMES_LOG("values of \"{}\":", #A); \
for(const auto& hermes_log_array_element : A) \
HERMES_LOG(" {}", hermes_log_array_element)

Logs array elements into info log stream.

Precondition
All elements must support std::stringstream << operator
Parameters
array/vectorobject

◆ HERMES_LOG_CRITICAL

#define HERMES_LOG_CRITICAL (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
hermes::Log::logMessage(hermes::logging_options::critical, FMT, \
hermes::Log::Location{__FILE__, __LINE__, __FUNCTION__} __VA_OPT__(,) __VA_ARGS__)

Logs into critical log stream.

HERMES_LOG_CRITICAL("my log with {} as value", 3) // produces "my log with 3 as value"
HERMES_LOG_CRITICAL("simple log")
#define HERMES_LOG_CRITICAL(FMT,...)
Logs into critical log stream.
Definition: logging.h:396
Parameters
FMTa const char* following hermes format (use "{}" to place each value in the string)
...format values

◆ HERMES_LOG_ERROR

#define HERMES_LOG_ERROR (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
hermes::Log::logMessage(hermes::logging_options::error, FMT, \
hermes::Log::Location{__FILE__, __LINE__, __FUNCTION__} __VA_OPT__(,) __VA_ARGS__)

Logs into error log stream.

HERMES_LOG_ERROR("my log with {} as value", 3) // produces "my log with 3 as value"
HERMES_LOG_ERROR("simple log")
#define HERMES_LOG_ERROR(FMT,...)
Logs into error log stream.
Definition: logging.h:385
Parameters
FMTa const char* following hermes format (use "{}" to place each value in the string)
...format values

◆ HERMES_LOG_VARIABLE

#define HERMES_LOG_VARIABLE (   A)

#include <hermes/logging/logging.h>

Value:
hermes::Log::logMessage(hermes::logging_options::info, "{} = {}", \
hermes::Log::Location{__FILE__, __LINE__, __FUNCTION__}, #A, A)

Logs variable name and value into info log stream.

Precondition
All variables must support std::stringstream << operator
Parameters
Avariable or literal

◆ HERMES_LOG_VARIABLES

#define HERMES_LOG_VARIABLES (   ...)     hermes::Log::info("[{}][{}][{}]: {}", __FILE__, __LINE__, __FUNCTION__, hermes_log_variables(__VA_ARGS__))

#include <hermes/logging/logging.h>

Logs multiple variables into info log stream.

Precondition
All variables must support std::stringstream << operator
Parameters
...variables

◆ HERMES_LOG_WARNING

#define HERMES_LOG_WARNING (   FMT,
  ... 
)

#include <hermes/logging/logging.h>

Value:
hermes::Log::logMessage(hermes::logging_options::warn, FMT, \
hermes::Log::Location{__FILE__, __LINE__, __FUNCTION__} __VA_OPT__(,) __VA_ARGS__)

Logs into warning log stream.

HERMES_LOG_WARNING("my log with {} as value", 3) // produces "my log with 3 as value"
HERMES_LOG_WARNING("simple log")
#define HERMES_LOG_WARNING(FMT,...)
Logs into warning log stream.
Definition: logging.h:374
Parameters
FMTa const char* following hermes format (use "{}" to place each value in the string)
...format values