KDSPDSetup
Small library to initialize spdlog loggers from a toml configuration file.
KDSPDSetup Namespace Reference

The only public-facing namespace in the library. More...

Namespaces

 details
 This namespace contains implementation details and helpers used by functions in KDSPDSetup::setup. This includes lookup for sink types and spdlog enums, maps to contain named sinks, patterns, and thread pools (to be used when constructing loggers), and functions that actually construct sink pointers of specific types.
 
 setup
 This namespace contains the functions directly called by KDSPDSetup::setupFrom, along with helpers called by those functions. The file which contains the definitions for members of KDSPDSetup::setup, setup.h, is included in the implementation file kdspdsetup.cpp The functions defined in this namespace make use of the members of namespace KDSPDSetup::details, defined in details.h.
 

Functions

void setupFrom (std::string const &file)
 This function performs all setup needed to start logging. It should be the only callable part of the library. More...
 

Detailed Description

The only public-facing namespace in the library.

Function Documentation

◆ setupFrom()

void KDSPDSetup::setupFrom ( std::string const &  file)

This function performs all setup needed to start logging. It should be the only callable part of the library.

Parameters
fileThe toml configuration file to read from.

Definition at line 16 of file kdspdsetup.cpp.

17 {
18  auto const data = toml::parse(file);
19 
20  setup::setupSinks(data);
23  setup::setupLoggers(data);
24 }
void setupLoggers(toml::value const &data)
Using data read from a toml file, extract vector of tables representing every logger specified....
Definition: setup.cpp:243
void setupPatterns(toml::value const &data)
Using data read from a toml file, search for the key global_pattern. If it exists,...
Definition: setup.cpp:108
void setupSinks(toml::value const &data)
Using data read from a toml file, extract vector of tables representing every sink specified....
Definition: setup.cpp:99
void setupThreadPools(toml::value const &data)
Using data read from a toml file, search for a table global_thread_pool, and initialize it with the s...
Definition: setup.cpp:127
Here is the call graph for this function: