Veethree D7 SDK
Loading...
Searching...
No Matches
vsdk::diag::log Class Reference

Detailed Description

logging with module-based filtering

This class provides a logging system that:

  • Supports module-based filtering
  • Allows both console and file output
  • Configurable through JSON configuration file

#include <log.h>

Public Types

using log_func
 Function type for logging operations.

Public Member Functions

void load_config_file (const std::string &path)
 Load configuration from JSON file.
void load_config_json (const nlohmann::json &cfg)
 Load configuration from JSON object.
void clear_config ()
 Remove the current configuration, disabling any logging.
 log (const log &)=delete
log & operator= (const log &)=delete
 log (log &&)=delete
log & operator= (log &&)=delete

Static Public Member Functions

static log * instance ()
 Get a pointer to the singleton instance.
template<typename... 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.

Detailed Description

logging with module-based filtering

This class provides a logging system that:

  • Supports module-based filtering
  • Allows both console and file output
  • Configurable through JSON configuration file

Member Typedef Documentation

◆ log_func

Initial value:
std::function<
void(spdlog::source_loc, spdlog::level::level_enum, fmt::string_view, fmt::format_args)>

Function type for logging operations.

Can be either an active logging function or an empty function based on module configuration and/or log level

Member Function Documentation

◆ load_config_file()

void vsdk::diag::log::load_config_file ( const std::string & path)

Load configuration from JSON file.

Parameters
pathPath to configuration file

◆ load_config_json()

void vsdk::diag::log::load_config_json ( const nlohmann::json & cfg)

Load configuration from JSON object.

Parameters
cfgJSON object containing the configuration

◆ logger()

template<typename... Args>
void vsdk::diag::log::logger ( module module,
spdlog::source_loc loc,
spdlog::level::level_enum lvl,
fmt::format_string< Args... > fmt,
const Args &... args )
inlinestatic

Templated wrapper for type-safe logging.

Parameters
moduleThe module generating the log
locSource location information
lvllog level
fmtFormat string
argsFormat arguments

The documentation for this class was generated from the following file: