1#ifndef UTOPIA_CORE_LOGGING_HH
2#define UTOPIA_CORE_LOGGING_HH
6#include <spdlog/spdlog.h>
7#include <spdlog/sinks/stdout_color_sinks.h>
32 const std::string name,
33 const spdlog::level::level_enum
level,
37 auto logger = spdlog::get(name);
41 logger = spdlog::stdout_color_mt(name);
67 const spdlog::level::level_enum
level_core = spdlog::level::warn,
68 const spdlog::level::level_enum
level_data_io = spdlog::level::warn,
77 spdlog::flush_on(spdlog::level::err);
85 spdlog::set_pattern(
"[%T.%e] [%^%l%$] [%n] %v");
88 spdlog::get(
"core")->info(
"Set up loggers: core, data_io, data_mngr.");
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
const std::string log_data_mngr
Definition logging.hh:20
std::shared_ptr< spdlog::logger > init_logger(const std::string name, const spdlog::level::level_enum level, const bool throw_on_exist=true)
Initialize a logger with a certain name and log level.
Definition logging.hh:31
void setup_loggers(const spdlog::level::level_enum level_core=spdlog::level::warn, const spdlog::level::level_enum level_data_io=spdlog::level::warn, const spdlog::level::level_enum level_data_mngr=spdlog::level::warn, const std::string &log_pattern="")
Set up and register the global loggers and set the global log pattern.
Definition logging.hh:66
const std::string log_core
Definition logging.hh:18
const std::string log_data_io
Definition logging.hh:19