More template instantiations for static lib

This commit is contained in:
gabime 2019-05-12 16:11:35 +03:00
parent 01f5efa1d9
commit 8b4eedb594
4 changed files with 51 additions and 18 deletions

View File

@ -0,0 +1,34 @@
// Copyright(c) 2015-present Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
#include "spdlog/logger.h"
#include "spdlog/common.h"
namespace spdlog {
template<typename Factory>
SPDLOG_INLINE std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name)
{
return Factory::template create<sinks::stdout_color_sink_mt>(logger_name);
}
template<typename Factory>
SPDLOG_INLINE std::shared_ptr<logger> stdout_color_st(const std::string &logger_name)
{
return Factory::template create<sinks::stdout_color_sink_st>(logger_name);
}
template<typename Factory>
SPDLOG_INLINE std::shared_ptr<logger> stderr_color_mt(const std::string &logger_name)
{
return Factory::template create<sinks::stderr_color_sink_mt>(logger_name);
}
template<typename Factory>
SPDLOG_INLINE std::shared_ptr<logger> stderr_color_st(const std::string &logger_name)
{
return Factory::template create<sinks::stderr_color_sink_st>(logger_name);
}
} // namespace spdlog

View File

@ -29,26 +29,19 @@ using stderr_color_sink_st = ansicolor_stderr_sink_st;
} // namespace sinks
template<typename Factory = default_factory>
inline std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name)
{
return Factory::template create<sinks::stdout_color_sink_mt>(logger_name);
}
std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name);
template<typename Factory = default_factory>
inline std::shared_ptr<logger> stdout_color_st(const std::string &logger_name)
{
return Factory::template create<sinks::stdout_color_sink_st>(logger_name);
}
std::shared_ptr<logger> stdout_color_st(const std::string &logger_name);
template<typename Factory = default_factory>
inline std::shared_ptr<logger> stderr_color_mt(const std::string &logger_name)
{
return Factory::template create<sinks::stderr_color_sink_mt>(logger_name);
}
std::shared_ptr<logger> stderr_color_mt(const std::string &logger_name);
template<typename Factory = default_factory>
inline std::shared_ptr<logger> stderr_color_st(const std::string &logger_name)
{
return Factory::template create<sinks::stderr_color_sink_st>(logger_name);
}
std::shared_ptr<logger> stderr_color_st(const std::string &logger_name);
} // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY
#include "stdout_color_sinks-inl.h"
#endif

View File

@ -1,5 +1,7 @@
#pragma once
// Copyright(c) 2015-present Gabi Melman & spdlog contributors.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once
namespace spdlog {
namespace sinks {
@ -18,7 +20,7 @@ SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::wincolor_sink()
}
template<typename TargetStream, typename ConsoleMutex>
SPDLOG_INLINE SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::~wincolor_sink()
SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::~wincolor_sink()
{
this->flush();
}

View File

@ -69,3 +69,7 @@ using wincolor_stderr_sink_st = wincolor_sink<details::console_stderr, details::
} // namespace sinks
} // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY
#include "wincolor_sink-inl.h"
#endif