Static Public Member Functions | List of all members
spdlog::async_factory_impl< OverflowPolicy > Struct Template Reference

#include <async.h>

Static Public Member Functions

template<typename Sink , typename... SinkArgs>
static std::shared_ptr< async_loggercreate (std::string logger_name, SinkArgs &&...args)
 

Detailed Description

template<async_overflow_policy OverflowPolicy = async_overflow_policy::block>
struct spdlog::async_factory_impl< OverflowPolicy >

Definition at line 37 of file async.h.

Member Function Documentation

template<async_overflow_policy OverflowPolicy = async_overflow_policy::block>
template<typename Sink , typename... SinkArgs>
static std::shared_ptr<async_logger> spdlog::async_factory_impl< OverflowPolicy >::create ( std::string  logger_name,
SinkArgs &&...  args 
)
inlinestatic

Definition at line 40 of file async.h.

41  {
42  auto &registry_inst = details::registry::instance();
43 
44  // create global thread pool if not already exists..
45  std::lock_guard<std::recursive_mutex> tp_lock(registry_inst.tp_mutex());
46  auto tp = registry_inst.get_tp();
47  if (tp == nullptr)
48  {
49  tp = std::make_shared<details::thread_pool>(details::default_async_q_size, 1);
50  registry_inst.set_tp(tp);
51  }
52 
53  auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...);
54  auto new_logger = std::make_shared<async_logger>(std::move(logger_name), std::move(sink), std::move(tp), OverflowPolicy);
55  registry_inst.initialize_logger(new_logger);
56  return new_logger;
57  }
static registry & instance()
Definition: registry.h:228
static QCString args
Definition: declinfo.cpp:674
static const size_t default_async_q_size
Definition: async.h:30
def move(depos, offset)
Definition: depos.py:107

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