Changed clang formatting for templates

This commit is contained in:
gabime
2018-03-16 17:13:50 +02:00
parent f4ce52d206
commit 5afb5dc782
29 changed files with 291 additions and 288 deletions

View File

@@ -16,7 +16,7 @@
#include <memory>
#include <string>
template <class It>
template<class It>
inline spdlog::async_logger::async_logger(const std::string &logger_name, const It &begin, const It &end, size_t queue_size,
const async_overflow_policy overflow_policy, const std::function<void()> &worker_warmup_cb,
const std::chrono::milliseconds &flush_interval_ms, const std::function<void()> &worker_teardown_cb)

View File

@@ -13,7 +13,7 @@
// create logger with given name, sinks and the default pattern formatter
// 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)
: _name(std::move(logger_name))
, _sinks(begin, end)
@@ -50,7 +50,7 @@ inline void spdlog::logger::set_pattern(const std::string &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))
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))
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))
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...);
}
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...);
}
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...);
}
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...);
}
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...);
}
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...);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
@@ -183,14 +183,14 @@ template <typename T> inline void spdlog::logger::critical(const T &msg)
#include <codecvt>
#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;
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;
@@ -198,32 +198,32 @@ template <typename... Args> inline void spdlog::logger::log(level::level_enum lv
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...);
}
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...);
}
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...);
}
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...);
}
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...);
}
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...);
}

View File

@@ -50,7 +50,7 @@ Distributed under the MIT License (http://opensource.org/licenses/MIT)
namespace spdlog { namespace details {
template <typename T> class mpmc_bounded_queue
template<typename T> class mpmc_bounded_queue
{
public:
using item_type = T;

View File

@@ -23,7 +23,7 @@
#include <unordered_map>
namespace spdlog { namespace details {
template <class Mutex> class registry_t
template<class Mutex> class registry_t
{
public:
registry_t<Mutex>(const registry_t<Mutex> &) = delete;
@@ -44,7 +44,7 @@ public:
return found == _loggers.end() ? nullptr : found->second;
}
template <class It> std::shared_ptr<logger> create(const std::string &logger_name, const It &sinks_begin, const It &sinks_end)
template<class It> std::shared_ptr<logger> create(const std::string &logger_name, const It &sinks_begin, const It &sinks_end)
{
std::lock_guard<Mutex> lock(_mutex);
throw_if_exists(logger_name);
@@ -69,7 +69,7 @@ public:
return new_logger;
}
template <class It>
template<class It>
std::shared_ptr<async_logger> create_async(const std::string &logger_name, size_t queue_size,
const async_overflow_policy overflow_policy, const std::function<void()> &worker_warmup_cb,
const std::chrono::milliseconds &flush_interval_ms, const std::function<void()> &worker_teardown_cb, const It &sinks_begin,

View File

@@ -190,14 +190,14 @@ inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string &logger_
return details::registry::instance().create(logger_name, sinks);
}
template <typename Sink, typename... Args>
template<typename Sink, typename... Args>
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string &logger_name, Args... args)
{
sink_ptr sink = std::make_shared<Sink>(args...);
return details::registry::instance().create(logger_name, {sink});
}
template <class It>
template<class It>
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string &logger_name, const It &sinks_begin, const It &sinks_end)
{
return details::registry::instance().create(logger_name, sinks_begin, sinks_end);
@@ -221,7 +221,7 @@ inline std::shared_ptr<spdlog::logger> spdlog::create_async(const std::string &l
logger_name, queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb, sinks);
}
template <class It>
template<class It>
inline std::shared_ptr<spdlog::logger> spdlog::create_async(const std::string &logger_name, const It &sinks_begin, const It &sinks_end,
size_t queue_size, const async_overflow_policy overflow_policy, const std::function<void()> &worker_warmup_cb,
const std::chrono::milliseconds &flush_interval_ms, const std::function<void()> &worker_teardown_cb)