Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
spdlog::details::registry_t< Mutex > Class Template Reference

#include <registry.h>

Public Member Functions

void register_logger (std::shared_ptr< logger > logger)
 
std::shared_ptr< loggerget (const std::string &logger_name)
 
template<class It >
std::shared_ptr< loggercreate (const std::string &logger_name, const It &sinks_begin, const It &sinks_end)
 
template<class It >
std::shared_ptr< async_logger > create_async (const std::string &logger_name, size_t queue_size, const async_overflow_policy overflow_policy, const std::function< void()> &worker_warmup_cb, const std::chrono::milliseconds &flush_interval_ms, const std::function< void()> &worker_teardown_cb, const It &sinks_begin, const It &sinks_end)
 
void apply_all (std::function< void(std::shared_ptr< logger >)> fun)
 
void drop (const std::string &logger_name)
 
void drop_all ()
 
std::shared_ptr< loggercreate (const std::string &logger_name, sinks_init_list sinks)
 
std::shared_ptr< loggercreate (const std::string &logger_name, sink_ptr sink)
 
std::shared_ptr< async_logger > create_async (const std::string &logger_name, size_t queue_size, const async_overflow_policy overflow_policy, const std::function< void()> &worker_warmup_cb, const std::chrono::milliseconds &flush_interval_ms, const std::function< void()> &worker_teardown_cb, sinks_init_list sinks)
 
std::shared_ptr< async_logger > create_async (const std::string &logger_name, size_t queue_size, const async_overflow_policy overflow_policy, const std::function< void()> &worker_warmup_cb, const std::chrono::milliseconds &flush_interval_ms, const std::function< void()> &worker_teardown_cb, sink_ptr sink)
 
void formatter (formatter_ptr f)
 
void set_pattern (const std::string &pattern)
 
void set_level (level::level_enum log_level)
 
void set_error_handler (log_err_handler handler)
 
void set_async_mode (size_t q_size, const async_overflow_policy overflow_policy, const std::function< void()> &worker_warmup_cb, const std::chrono::milliseconds &flush_interval_ms, const std::function< void()> &worker_teardown_cb)
 
void set_sync_mode ()
 

Static Public Member Functions

static registry_t< Mutex > & instance ()
 

Private Member Functions

 registry_t ()
 
 registry_t (const registry_t< Mutex > &)=delete
 
registry_t< Mutex > & operator= (const registry_t< Mutex > &)=delete
 
void throw_if_exists (const std::string &logger_name)
 

Private Attributes

Mutex _mutex
 
std::unordered_map< std::string, std::shared_ptr< logger > > _loggers
 
formatter_ptr _formatter
 
level::level_enum _level = level::info
 
log_err_handler _err_handler
 
bool _async_mode = false
 
size_t _async_q_size = 0
 
async_overflow_policy _overflow_policy = async_overflow_policy::block_retry
 
std::function< void()> _worker_warmup_cb = nullptr
 
std::chrono::milliseconds _flush_interval_ms
 
std::function< void()> _worker_teardown_cb = nullptr
 

Detailed Description

template<class Mutex>
class spdlog::details::registry_t< Mutex >

Definition at line 29 of file registry.h.

Constructor & Destructor Documentation

◆ registry_t() [1/2]

template<class Mutex >
spdlog::details::registry_t< Mutex >::registry_t ( )
inlineprivate

Definition at line 180 of file registry.h.

◆ registry_t() [2/2]

template<class Mutex >
spdlog::details::registry_t< Mutex >::registry_t ( const registry_t< Mutex > & )
privatedelete

Member Function Documentation

◆ apply_all()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::apply_all ( std::function< void(std::shared_ptr< logger >)> fun)
inline

Definition at line 94 of file registry.h.

◆ create() [1/3]

template<class Mutex >
template<class It >
std::shared_ptr< logger > spdlog::details::registry_t< Mutex >::create ( const std::string & logger_name,
const It & sinks_begin,
const It & sinks_end )
inline

Definition at line 50 of file registry.h.

◆ create() [2/3]

template<class Mutex >
std::shared_ptr< logger > spdlog::details::registry_t< Mutex >::create ( const std::string & logger_name,
sink_ptr sink )
inline

Definition at line 117 of file registry.h.

◆ create() [3/3]

template<class Mutex >
std::shared_ptr< logger > spdlog::details::registry_t< Mutex >::create ( const std::string & logger_name,
sinks_init_list sinks )
inline

Definition at line 112 of file registry.h.

◆ create_async() [1/3]

template<class Mutex >
template<class It >
std::shared_ptr< async_logger > spdlog::details::registry_t< Mutex >::create_async ( const std::string & logger_name,
size_t queue_size,
const async_overflow_policy overflow_policy,
const std::function< void()> & worker_warmup_cb,
const std::chrono::milliseconds & flush_interval_ms,
const std::function< void()> & worker_teardown_cb,
const It & sinks_begin,
const It & sinks_end )
inline

Definition at line 75 of file registry.h.

◆ create_async() [2/3]

template<class Mutex >
std::shared_ptr< async_logger > spdlog::details::registry_t< Mutex >::create_async ( const std::string & logger_name,
size_t queue_size,
const async_overflow_policy overflow_policy,
const std::function< void()> & worker_warmup_cb,
const std::chrono::milliseconds & flush_interval_ms,
const std::function< void()> & worker_teardown_cb,
sink_ptr sink )
inline

Definition at line 127 of file registry.h.

◆ create_async() [3/3]

template<class Mutex >
std::shared_ptr< async_logger > spdlog::details::registry_t< Mutex >::create_async ( const std::string & logger_name,
size_t queue_size,
const async_overflow_policy overflow_policy,
const std::function< void()> & worker_warmup_cb,
const std::chrono::milliseconds & flush_interval_ms,
const std::function< void()> & worker_teardown_cb,
sinks_init_list sinks )
inline

Definition at line 122 of file registry.h.

◆ drop()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::drop ( const std::string & logger_name)
inline

Definition at line 101 of file registry.h.

◆ drop_all()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::drop_all ( )
inline

Definition at line 107 of file registry.h.

+ Here is the caller graph for this function:

◆ formatter()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::formatter ( formatter_ptr f)
inline

Definition at line 132 of file registry.h.

+ Here is the caller graph for this function:

◆ get()

template<class Mutex >
std::shared_ptr< logger > spdlog::details::registry_t< Mutex >::get ( const std::string & logger_name)
inline

Definition at line 42 of file registry.h.

◆ instance()

template<class Mutex >
static registry_t< Mutex > & spdlog::details::registry_t< Mutex >::instance ( )
inlinestatic

Definition at line 180 of file registry.h.

+ Here is the caller graph for this function:

◆ operator=()

template<class Mutex >
registry_t< Mutex > & spdlog::details::registry_t< Mutex >::operator= ( const registry_t< Mutex > & )
privatedelete

◆ register_logger()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::register_logger ( std::shared_ptr< logger > logger)
inline

Definition at line 33 of file registry.h.

◆ set_async_mode()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::set_async_mode ( size_t q_size,
const async_overflow_policy overflow_policy,
const std::function< void()> & worker_warmup_cb,
const std::chrono::milliseconds & flush_interval_ms,
const std::function< void()> & worker_teardown_cb )
inline

Definition at line 163 of file registry.h.

+ Here is the caller graph for this function:

◆ set_error_handler()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::set_error_handler ( log_err_handler handler)
inline

Definition at line 156 of file registry.h.

+ Here is the caller graph for this function:

◆ set_level()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::set_level ( level::level_enum log_level)
inline

Definition at line 148 of file registry.h.

+ Here is the caller graph for this function:

◆ set_pattern()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::set_pattern ( const std::string & pattern)
inline

Definition at line 140 of file registry.h.

◆ set_sync_mode()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::set_sync_mode ( )
inline

Definition at line 174 of file registry.h.

+ Here is the caller graph for this function:

◆ throw_if_exists()

template<class Mutex >
void spdlog::details::registry_t< Mutex >::throw_if_exists ( const std::string & logger_name)
inlineprivate

Definition at line 191 of file registry.h.

Member Data Documentation

◆ _async_mode

template<class Mutex >
bool spdlog::details::registry_t< Mutex >::_async_mode = false
private

Definition at line 201 of file registry.h.

◆ _async_q_size

template<class Mutex >
size_t spdlog::details::registry_t< Mutex >::_async_q_size = 0
private

Definition at line 202 of file registry.h.

◆ _err_handler

template<class Mutex >
log_err_handler spdlog::details::registry_t< Mutex >::_err_handler
private

Definition at line 200 of file registry.h.

◆ _flush_interval_ms

template<class Mutex >
std::chrono::milliseconds spdlog::details::registry_t< Mutex >::_flush_interval_ms
private

Definition at line 205 of file registry.h.

◆ _formatter

template<class Mutex >
formatter_ptr spdlog::details::registry_t< Mutex >::_formatter
private

Definition at line 198 of file registry.h.

◆ _level

template<class Mutex >
level::level_enum spdlog::details::registry_t< Mutex >::_level = level::info
private

Definition at line 199 of file registry.h.

◆ _loggers

template<class Mutex >
std::unordered_map<std::string, std::shared_ptr<logger> > spdlog::details::registry_t< Mutex >::_loggers
private

Definition at line 197 of file registry.h.

◆ _mutex

template<class Mutex >
Mutex spdlog::details::registry_t< Mutex >::_mutex
private

Definition at line 196 of file registry.h.

◆ _overflow_policy

template<class Mutex >
async_overflow_policy spdlog::details::registry_t< Mutex >::_overflow_policy = async_overflow_policy::block_retry
private

Definition at line 203 of file registry.h.

◆ _worker_teardown_cb

template<class Mutex >
std::function<void()> spdlog::details::registry_t< Mutex >::_worker_teardown_cb = nullptr
private

Definition at line 206 of file registry.h.

◆ _worker_warmup_cb

template<class Mutex >
std::function<void()> spdlog::details::registry_t< Mutex >::_worker_warmup_cb = nullptr
private

Definition at line 204 of file registry.h.


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