Agora
1.2.0
Agora project
|
Go to the documentation of this file.
17 #include <unordered_map>
25 class periodic_worker;
30 using log_levels = std::unordered_map<std::string, level::level_enum>;
36 std::shared_ptr<logger>
get(
const std::string &logger_name);
49 void set_tp(std::shared_ptr<thread_pool> tp);
51 std::shared_ptr<thread_pool> get_tp();
72 void drop(
const std::string &logger_name);
79 std::recursive_mutex &tp_mutex();
92 void throw_if_exists_(
const std::string &logger_name);
93 void register_logger_(std::shared_ptr<logger> new_logger);
97 std::unordered_map<std::string, std::shared_ptr<logger>>
loggers_;
103 std::shared_ptr<thread_pool>
tp_;
106 bool automatic_registration_ =
true;
107 size_t backtrace_n_messages_ = 0;
113 #ifdef SPDLOG_HEADER_ONLY
std::unordered_map< std::string, std::shared_ptr< logger > > loggers_
Definition: registry.h:97
SPDLOG_INLINE void set_error_handler(void(*handler)(const std::string &msg))
Definition: spdlog-inl.h:75
log_levels log_levels_
Definition: registry.h:98
std::shared_ptr< thread_pool > tp_
Definition: registry.h:103
@ off
Definition: common.h:219
SPDLOG_INLINE void initialize_logger(std::shared_ptr< logger > logger)
Definition: spdlog-inl.h:15
SPDLOG_INLINE void flush_every(std::chrono::seconds interval)
Definition: spdlog-inl.h:70
SPDLOG_INLINE std::shared_ptr< spdlog::logger > default_logger()
Definition: spdlog-inl.h:110
SPDLOG_INLINE void set_level(level::level_enum log_level)
Definition: spdlog-inl.h:60
Definition: registry.h:27
@ info
Definition: common.h:215
level_enum
Definition: common.h:211
SPDLOG_INLINE void set_automatic_registration(bool automatic_registration)
Definition: spdlog-inl.h:105
err_handler err_handler_
Definition: registry.h:102
std::unordered_map< std::string, level::level_enum > log_levels
Definition: registry.h:30
SPDLOG_INLINE void apply_all(const std::function< void(std::shared_ptr< logger >)> &fun)
Definition: spdlog-inl.h:85
SPDLOG_INLINE void enable_backtrace(size_t n_messages)
Definition: spdlog-inl.h:35
SPDLOG_INLINE void drop(const std::string &name)
Definition: spdlog-inl.h:90
std::mutex logger_map_mutex_
Definition: registry.h:95
SPDLOG_INLINE std::shared_ptr< logger > get(const std::string &name)
Definition: spdlog-inl.h:20
std::unique_ptr< periodic_worker > periodic_flusher_
Definition: registry.h:104
std::function< void(const std::string &err_msg)> err_handler
Definition: common.h:129
SPDLOG_INLINE void register_logger(std::shared_ptr< logger > logger)
Definition: spdlog-inl.h:80
SPDLOG_INLINE void set_default_logger(std::shared_ptr< spdlog::logger > default_logger)
Definition: spdlog-inl.h:120
std::unique_ptr< formatter > formatter_
Definition: registry.h:99
function[avg_proc_duration, std_proc_duration]
Definition: parse_dl_file.m:1
SPDLOG_INLINE void disable_backtrace()
Definition: spdlog-inl.h:40
SPDLOG_INLINE void set_formatter(std::unique_ptr< spdlog::formatter > formatter)
Definition: spdlog-inl.h:25
std::shared_ptr< spdlog::details::thread_pool > thread_pool()
Definition: async.h:95
SPDLOG_INLINE void shutdown()
Definition: spdlog-inl.h:100
#define SPDLOG_API
Definition: common.h:40
SPDLOG_INLINE void drop_all()
Definition: spdlog-inl.h:95
SPDLOG_INLINE void flush_on(level::level_enum log_level)
Definition: spdlog-inl.h:65
std::shared_ptr< logger > default_logger_
Definition: registry.h:105
std::recursive_mutex tp_mutex_
Definition: registry.h:96