Agora  1.2.0
Agora project
spdlog::details::registry Class Reference

#include <registry.h>

Public Types

using log_levels = std::unordered_map< std::string, level::level_enum >
 

Public Member Functions

 registry (const registry &)=delete
 
registryoperator= (const registry &)=delete
 
void register_logger (std::shared_ptr< logger > new_logger)
 
void initialize_logger (std::shared_ptr< logger > new_logger)
 
std::shared_ptr< loggerget (const std::string &logger_name)
 
std::shared_ptr< loggerdefault_logger ()
 
loggerget_default_raw ()
 
void set_default_logger (std::shared_ptr< logger > new_default_logger)
 
void set_tp (std::shared_ptr< thread_pool > tp)
 
std::shared_ptr< thread_poolget_tp ()
 
void set_formatter (std::unique_ptr< formatter > formatter)
 
void enable_backtrace (size_t n_messages)
 
void disable_backtrace ()
 
void set_level (level::level_enum log_level)
 
void flush_on (level::level_enum log_level)
 
void flush_every (std::chrono::seconds interval)
 
void set_error_handler (err_handler handler)
 
void apply_all (const std::function< void(const std::shared_ptr< logger >)> &fun)
 
void flush_all ()
 
void drop (const std::string &logger_name)
 
void drop_all ()
 
void shutdown ()
 
std::recursive_mutex & tp_mutex ()
 
void set_automatic_registration (bool automatic_registration)
 
void set_levels (log_levels levels, level::level_enum *global_level)
 

Static Public Member Functions

static registryinstance ()
 

Private Member Functions

 registry ()
 
 ~registry ()
 
void throw_if_exists_ (const std::string &logger_name)
 
void register_logger_ (std::shared_ptr< logger > new_logger)
 
bool set_level_from_cfg_ (logger *logger)
 

Private Attributes

std::mutex logger_map_mutex_
 
std::mutex flusher_mutex_
 
std::recursive_mutex tp_mutex_
 
std::unordered_map< std::string, std::shared_ptr< logger > > loggers_
 
log_levels log_levels_
 
std::unique_ptr< formatterformatter_
 
spdlog::level::level_enum global_log_level_ = level::info
 
level::level_enum flush_level_ = level::off
 
err_handler err_handler_
 
std::shared_ptr< thread_pooltp_
 
std::unique_ptr< periodic_workerperiodic_flusher_
 
std::shared_ptr< loggerdefault_logger_
 
bool automatic_registration_ = true
 
size_t backtrace_n_messages_ = 0
 

Member Typedef Documentation

◆ log_levels

using spdlog::details::registry::log_levels = std::unordered_map<std::string, level::level_enum>

Constructor & Destructor Documentation

◆ registry() [1/2]

spdlog::details::registry::registry ( const registry )
delete

◆ registry() [2/2]

SPDLOG_INLINE spdlog::details::registry::registry ( )
private

◆ ~registry()

SPDLOG_INLINE spdlog::details::registry::~registry ( )
privatedefault

Member Function Documentation

◆ apply_all()

SPDLOG_INLINE void spdlog::details::registry::apply_all ( const std::function< void(const std::shared_ptr< logger >)> &  fun)
Here is the caller graph for this function:

◆ default_logger()

SPDLOG_INLINE std::shared_ptr< logger > spdlog::details::registry::default_logger ( )
Here is the caller graph for this function:

◆ disable_backtrace()

SPDLOG_INLINE void spdlog::details::registry::disable_backtrace ( )
Here is the caller graph for this function:

◆ drop()

SPDLOG_INLINE void spdlog::details::registry::drop ( const std::string &  logger_name)
Here is the caller graph for this function:

◆ drop_all()

SPDLOG_INLINE void spdlog::details::registry::drop_all ( )
Here is the caller graph for this function:

◆ enable_backtrace()

SPDLOG_INLINE void spdlog::details::registry::enable_backtrace ( size_t  n_messages)
Here is the caller graph for this function:

◆ flush_all()

SPDLOG_INLINE void spdlog::details::registry::flush_all ( )
Here is the caller graph for this function:

◆ flush_every()

SPDLOG_INLINE void spdlog::details::registry::flush_every ( std::chrono::seconds  interval)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush_on()

SPDLOG_INLINE void spdlog::details::registry::flush_on ( level::level_enum  log_level)
Here is the caller graph for this function:

◆ get()

SPDLOG_INLINE std::shared_ptr< logger > spdlog::details::registry::get ( const std::string &  logger_name)
Here is the caller graph for this function:

◆ get_default_raw()

SPDLOG_INLINE logger * spdlog::details::registry::get_default_raw ( )
Here is the caller graph for this function:

◆ get_tp()

SPDLOG_INLINE std::shared_ptr< thread_pool > spdlog::details::registry::get_tp ( )
Here is the caller graph for this function:

◆ initialize_logger()

SPDLOG_INLINE void spdlog::details::registry::initialize_logger ( std::shared_ptr< logger new_logger)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

SPDLOG_INLINE registry & spdlog::details::registry::instance ( )
static
Here is the caller graph for this function:

◆ operator=()

registry& spdlog::details::registry::operator= ( const registry )
delete

◆ register_logger()

SPDLOG_INLINE void spdlog::details::registry::register_logger ( std::shared_ptr< logger new_logger)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_logger_()

SPDLOG_INLINE void spdlog::details::registry::register_logger_ ( std::shared_ptr< logger new_logger)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_automatic_registration()

SPDLOG_INLINE void spdlog::details::registry::set_automatic_registration ( bool  automatic_registration)
Here is the caller graph for this function:

◆ set_default_logger()

SPDLOG_INLINE void spdlog::details::registry::set_default_logger ( std::shared_ptr< logger new_default_logger)
Here is the caller graph for this function:

◆ set_error_handler()

SPDLOG_INLINE void spdlog::details::registry::set_error_handler ( err_handler  handler)
Here is the caller graph for this function:

◆ set_formatter()

SPDLOG_INLINE void spdlog::details::registry::set_formatter ( std::unique_ptr< formatter formatter)
Here is the caller graph for this function:

◆ set_level()

SPDLOG_INLINE void spdlog::details::registry::set_level ( level::level_enum  log_level)
Here is the caller graph for this function:

◆ set_level_from_cfg_()

bool spdlog::details::registry::set_level_from_cfg_ ( logger logger)
private

◆ set_levels()

SPDLOG_INLINE void spdlog::details::registry::set_levels ( log_levels  levels,
level::level_enum global_level 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_tp()

SPDLOG_INLINE void spdlog::details::registry::set_tp ( std::shared_ptr< thread_pool tp)
Here is the caller graph for this function:

◆ shutdown()

SPDLOG_INLINE void spdlog::details::registry::shutdown ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ throw_if_exists_()

SPDLOG_INLINE void spdlog::details::registry::throw_if_exists_ ( const std::string &  logger_name)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tp_mutex()

SPDLOG_INLINE std::recursive_mutex & spdlog::details::registry::tp_mutex ( )

Member Data Documentation

◆ automatic_registration_

bool spdlog::details::registry::automatic_registration_ = true
private

◆ backtrace_n_messages_

size_t spdlog::details::registry::backtrace_n_messages_ = 0
private

◆ default_logger_

std::shared_ptr<logger> spdlog::details::registry::default_logger_
private

◆ err_handler_

err_handler spdlog::details::registry::err_handler_
private

◆ flush_level_

level::level_enum spdlog::details::registry::flush_level_ = level::off
private

◆ flusher_mutex_

std::mutex spdlog::details::registry::flusher_mutex_
private

◆ formatter_

std::unique_ptr<formatter> spdlog::details::registry::formatter_
private

◆ global_log_level_

spdlog::level::level_enum spdlog::details::registry::global_log_level_ = level::info
private

◆ log_levels_

log_levels spdlog::details::registry::log_levels_
private

◆ logger_map_mutex_

std::mutex spdlog::details::registry::logger_map_mutex_
private

◆ loggers_

std::unordered_map<std::string, std::shared_ptr<logger> > spdlog::details::registry::loggers_
private

◆ periodic_flusher_

std::unique_ptr<periodic_worker> spdlog::details::registry::periodic_flusher_
private

◆ tp_

std::shared_ptr<thread_pool> spdlog::details::registry::tp_
private

◆ tp_mutex_

std::recursive_mutex spdlog::details::registry::tp_mutex_
private

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