Agora
1.2.0
Agora project
synchronous_factory.h
Go to the documentation of this file.
1
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
2
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
3
4
#pragma once
5
6
#include "
registry.h
"
7
8
namespace
spdlog
{
9
10
// Default logger factory- creates synchronous loggers
11
class
logger;
12
13
struct
synchronous_factory
14
{
15
template
<
typename
Sink,
typename
... SinkArgs>
16
static
std::shared_ptr<spdlog::logger>
create
(std::string logger_name, SinkArgs &&... args)
17
{
18
auto
sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...);
19
auto
new_logger = std::make_shared<spdlog::logger>(std::move(logger_name), std::move(sink));
20
details::registry::instance
().
initialize_logger
(new_logger);
21
return
new_logger;
22
}
23
};
24
}
// namespace spdlog
spdlog::synchronous_factory::create
static std::shared_ptr< spdlog::logger > create(std::string logger_name, SinkArgs &&... args)
Definition:
synchronous_factory.h:16
spdlog::synchronous_factory
Definition:
synchronous_factory.h:13
spdlog
Definition:
async.h:25
spdlog::details::registry::initialize_logger
void initialize_logger(std::shared_ptr< logger > new_logger)
Definition:
registry-inl.h:60
registry.h
spdlog::details::registry::instance
static registry & instance()
Definition:
registry-inl.h:291
third_party
spdlog
include
spdlog
details
synchronous_factory.h
Generated by
1.8.17