|
|
@ -13,7 +13,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
// create logger with given name, sinks and the default pattern formatter
|
|
|
|
// create logger with given name, sinks and the default pattern formatter
|
|
|
|
// all other ctors will call this one
|
|
|
|
// all other ctors will call this one
|
|
|
|
template <class It>
|
|
|
|
template<class It>
|
|
|
|
inline spdlog::logger::logger(std::string logger_name, const It &begin, const It &end)
|
|
|
|
inline spdlog::logger::logger(std::string logger_name, const It &begin, const It &end)
|
|
|
|
: _name(std::move(logger_name))
|
|
|
|
: _name(std::move(logger_name))
|
|
|
|
, _sinks(begin, end)
|
|
|
|
, _sinks(begin, end)
|
|
|
@ -50,7 +50,7 @@ inline void spdlog::logger::set_pattern(const std::string &pattern, pattern_time
|
|
|
|
_set_pattern(pattern, pattern_time);
|
|
|
|
_set_pattern(pattern, pattern_time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const char *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const char *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!should_log(lvl))
|
|
|
|
if (!should_log(lvl))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -77,7 +77,7 @@ template <typename... Args> inline void spdlog::logger::log(level::level_enum lv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const char *msg)
|
|
|
|
template<typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const char *msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!should_log(lvl))
|
|
|
|
if (!should_log(lvl))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -98,7 +98,7 @@ template <typename... Args> inline void spdlog::logger::log(level::level_enum lv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::log(level::level_enum lvl, const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::log(level::level_enum lvl, const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!should_log(lvl))
|
|
|
|
if (!should_log(lvl))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -119,62 +119,62 @@ template <typename T> inline void spdlog::logger::log(level::level_enum lvl, con
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::trace(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::trace(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::trace, fmt, arg1, args...);
|
|
|
|
log(level::trace, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::debug(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::debug(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::debug, fmt, arg1, args...);
|
|
|
|
log(level::debug, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::info(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::info(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::info, fmt, arg1, args...);
|
|
|
|
log(level::info, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::warn(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::warn(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::warn, fmt, arg1, args...);
|
|
|
|
log(level::warn, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::error(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::error(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::err, fmt, arg1, args...);
|
|
|
|
log(level::err, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Arg1, typename... Args> inline void spdlog::logger::critical(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
template<typename Arg1, typename... Args> inline void spdlog::logger::critical(const char *fmt, const Arg1 &arg1, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::critical, fmt, arg1, args...);
|
|
|
|
log(level::critical, fmt, arg1, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::trace(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::trace(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::trace, msg);
|
|
|
|
log(level::trace, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::debug(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::debug(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::debug, msg);
|
|
|
|
log(level::debug, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::info(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::info(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::info, msg);
|
|
|
|
log(level::info, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::warn(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::warn(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::warn, msg);
|
|
|
|
log(level::warn, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::error(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::error(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::err, msg);
|
|
|
|
log(level::err, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T> inline void spdlog::logger::critical(const T &msg)
|
|
|
|
template<typename T> inline void spdlog::logger::critical(const T &msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::critical, msg);
|
|
|
|
log(level::critical, msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -183,14 +183,14 @@ template <typename T> inline void spdlog::logger::critical(const T &msg)
|
|
|
|
#include <codecvt>
|
|
|
|
#include <codecvt>
|
|
|
|
#include <locale>
|
|
|
|
#include <locale>
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const wchar_t *msg)
|
|
|
|
template<typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const wchar_t *msg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
|
|
|
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
|
|
|
|
|
|
|
|
|
|
|
|
log(lvl, conv.to_bytes(msg));
|
|
|
|
log(lvl, conv.to_bytes(msg));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::log(level::level_enum lvl, const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fmt::WMemoryWriter wWriter;
|
|
|
|
fmt::WMemoryWriter wWriter;
|
|
|
|
|
|
|
|
|
|
|
@ -198,32 +198,32 @@ template <typename... Args> inline void spdlog::logger::log(level::level_enum lv
|
|
|
|
log(lvl, wWriter.c_str());
|
|
|
|
log(lvl, wWriter.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::trace(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::trace(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::trace, fmt, args...);
|
|
|
|
log(level::trace, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::debug(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::debug(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::debug, fmt, args...);
|
|
|
|
log(level::debug, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::info(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::info(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::info, fmt, args...);
|
|
|
|
log(level::info, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::warn(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::warn(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::warn, fmt, args...);
|
|
|
|
log(level::warn, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::error(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::error(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::err, fmt, args...);
|
|
|
|
log(level::err, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <typename... Args> inline void spdlog::logger::critical(const wchar_t *fmt, const Args &... args)
|
|
|
|
template<typename... Args> inline void spdlog::logger::critical(const wchar_t *fmt, const Args &... args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log(level::critical, fmt, args...);
|
|
|
|
log(level::critical, fmt, args...);
|
|
|
|
}
|
|
|
|
}
|
|
|
|