Moved default sync factory to seperate file to avoid cyclic includes

This commit is contained in:
gabime
2019-06-03 23:56:18 +03:00
parent c35f33e61a
commit eea9d6136f
13 changed files with 58 additions and 35 deletions

View File

@@ -4,6 +4,7 @@
#pragma once
#include "spdlog/sinks/base_sink.h"
#include "spdlog/details/synchronous_factory.h"
#include <array>
#include <string>
@@ -65,13 +66,13 @@ using systemd_sink_st = systemd_sink<details::null_mutex>;
} // namespace sinks
// Create and register a syslog logger
template<typename Factory = default_factory>
template<typename Factory = spdlog::synchronous_factory>
inline std::shared_ptr<logger> systemd_logger_mt(const std::string &logger_name)
{
return Factory::template create<sinks::systemd_sink_mt>(logger_name);
}
template<typename Factory = default_factory>
template<typename Factory = spdlog::synchronous_factory>
inline std::shared_ptr<logger> systemd_logger_st(const std::string &logger_name)
{
return Factory::template create<sinks::systemd_sink_st>(logger_name);