Veethree D7 SDK
Loading...
Searching...
No Matches
log.h File Reference

Detailed Description

Logging interface.

#include <spdlog/common.h>
#include <spdlog/spdlog.h>
#include <functional>
#include <map>
#include <nlohmann/json.hpp>
#include <string>
#include <utility>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vsdk::diag::log
 logging with module-based filtering More...

Namespaces

namespace  vsdk
 Any entities that belong to the Veethree SDK libraries.

Macros

#define LOG_TRACE(module, ...)
 Produce a log at the TRACE level.
#define LOG_DEBUG(module, ...)
 Produce a log at the DEBUG level.
#define LOG_INFO(module, ...)
 Produce a log at the INFO level.
#define LOG_WARN(module, ...)
 Produce a log at the WARN level.
#define LOG_ERROR(module, ...)
 Produce a log at the ERROR level.
#define LOG_CRITICAL(module, ...)
 Produce a log at the CRITICAL level.

Enumerations

enum class  module : uint8_t {
  module::pwm_in , module::pwm_out , module::digital_in , module::digital_out ,
  module::analog , module::system , module::network , module::comms ,
  module::ct2klib , module::max
}
 Enumeration of available logging modules. More...

Detailed Description

Logging interface.

Macro Definition Documentation

◆ LOG_CRITICAL

#define LOG_CRITICAL ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::critical, \
##__VA_ARGS__)
static void logger(module module, spdlog::source_loc loc, spdlog::level::level_enum lvl, fmt::format_string< Args... > fmt, const Args &... args)
Templated wrapper for type-safe logging.
Definition log.h:190
module
Enumeration of available logging modules.
Definition log.h:33

Produce a log at the CRITICAL level.

Parameters
moduleThe module generating the log
...Format arguments

◆ LOG_DEBUG

#define LOG_DEBUG ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::debug, \
##__VA_ARGS__)

Produce a log at the DEBUG level.

Parameters
moduleThe module generating the log
...Format arguments

◆ LOG_ERROR

#define LOG_ERROR ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::err, \
##__VA_ARGS__)

Produce a log at the ERROR level.

Parameters
moduleThe module generating the log
...Format arguments

◆ LOG_INFO

#define LOG_INFO ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::info, \
##__VA_ARGS__)

Produce a log at the INFO level.

Parameters
moduleThe module generating the log
...Format arguments

◆ LOG_TRACE

#define LOG_TRACE ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::trace, \
##__VA_ARGS__)

Produce a log at the TRACE level.

Parameters
moduleThe module generating the log
...Format arguments

◆ LOG_WARN

#define LOG_WARN ( module,
... )
Value:
spdlog::source_loc{ __FILE__, __LINE__, SPDLOG_FUNCTION }, \
spdlog::level::warn, \
##__VA_ARGS__)

Produce a log at the WARN level.

Parameters
moduleThe module generating the log
...Format arguments