Photon 1.0.0
Loading...
Searching...
No Matches
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
8namespace spdlog
9{
10
11 // Default logger factory- creates synchronous loggers
12 class logger;
13
15 {
16 template <typename Sink, typename... SinkArgs>
17 static std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs&&... args)
18 {
19 auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...);
20 auto new_logger = std::make_shared<spdlog::logger>(std::move(logger_name), std::move(sink));
22 return new_logger;
23 }
24 };
25} // namespace spdlog
static registry & instance()
Definition registry-inl.h:286
void initialize_logger(std::shared_ptr< logger > new_logger)
Definition registry-inl.h:62
Definition async.h:26
Definition synchronous_factory.h:15
static std::shared_ptr< spdlog::logger > create(std::string logger_name, SinkArgs &&... args)
Definition synchronous_factory.h:17