logman 0.1.0
Modern C++23 header-only logging manager wrapping spdlog with channels, listeners, and structured events
Loading...
Searching...
No Matches
init_config.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <spdlog/spdlog.h>
7
8#include <string>
9#include <vector>
10
11namespace logman {
12
16struct InitConfig {
20 spdlog::level::level_enum default_level = spdlog::level::info;
21
25 bool enable_console = true;
26
31 std::string pattern;
32
37
40 bool read_env = true;
41
46 std::vector<std::string> env_prefixes;
47
51 bool structured_json = false;
52};
53
54} // namespace logman
Settings applied during LogManager::initialize(InitConfig).
Definition init_config.hpp:16
std::vector< std::string > env_prefixes
Prefixes to scan when read_env is true.
Definition init_config.hpp:46
bool read_env
When true, scan the process environment under env_prefixes for <PREFIX>LEVEL, <PREFIX>LEVEL_<NAMESPAC...
Definition init_config.hpp:40
bool structured_json
Emit one JSON object per line via JsonFormatter.
Definition init_config.hpp:51
bool enable_console
Install the colour console sink.
Definition init_config.hpp:25
std::string pattern
spdlog pattern string.
Definition init_config.hpp:31
spdlog::level::level_enum default_level
Default level applied to the root logger and every channel created without an explicit prefix rule.
Definition init_config.hpp:20
bool set_as_spdlog_default
Install the "main" logger as spdlog::default_logger().
Definition init_config.hpp:36