diff --git a/bench/async_bench.cpp b/bench/async_bench.cpp index c82e7f2b..cd310ae8 100644 --- a/bench/async_bench.cpp +++ b/bench/async_bench.cpp @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) auto file_sink = std::make_shared(filename, true); auto logger = std::make_shared("async_logger", std::move(file_sink), std::move(tp), async_overflow_policy::block); bench_mt(howmany, std::move(logger), threads); - //verify_file(filename, howmany); + // verify_file(filename, howmany); } spdlog::info(""); diff --git a/bench/formatter-bench.cpp b/bench/formatter-bench.cpp index d55ee3f1..1045913f 100644 --- a/bench/formatter-bench.cpp +++ b/bench/formatter-bench.cpp @@ -12,13 +12,13 @@ void bench_formatter(benchmark::State &state, std::string pattern) { std::unique_ptr formatter; - if(pattern == "%+") + if (pattern == "%+") { formatter = spdlog::details::make_unique(); } else { - formatter = spdlog::details::make_unique(pattern); + formatter = spdlog::details::make_unique(pattern); } spdlog::memory_buf_t dest; diff --git a/example/example.cpp b/example/example.cpp index 8c06f91b..1b8597cb 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -119,13 +119,13 @@ void load_levels_example() // SPDLOG_LEVEL=info,mylogger=trace && ./example auto levels = spdlog::cfg::load_env_levels(); auto it = levels.find(spdlog::default_logger()->name()); - if(it != levels.end()) + if (it != levels.end()) spdlog::default_logger()->set_level(it->second); auto my_logger = spdlog::basic_logger_mt("my_logger", "logs/my-logger.txt"); it = levels.find(my_logger->name()); - if(it != levels.end()) - my_logger ->set_level(it->second); + if (it != levels.end()) + my_logger->set_level(it->second); // or from command line: // ./example SPDLOG_LEVEL=info,mylogger=trace @@ -245,7 +245,8 @@ void user_defined_example() void err_handler_example() { // can be set globally or per logger(logger->set_error_handler(..)) - spdlog::default_logger()->set_error_handler([](const std::string &msg) { printf("*** Custom log error handler: %s ***\n", msg.c_str()); }); + spdlog::default_logger()->set_error_handler( + [](const std::string &msg) { printf("*** Custom log error handler: %s ***\n", msg.c_str()); }); } // syslog example (linux/osx/freebsd) diff --git a/include/spdlog/async.h b/include/spdlog/async.h index 4affc6ae..51e3eaa7 100644 --- a/include/spdlog/async.h +++ b/include/spdlog/async.h @@ -27,7 +27,7 @@ namespace details { static const size_t default_async_q_size = 8192; static std::shared_ptr s_thread_pool; static std::recursive_mutex s_thread_pool_mutex; -} +} // namespace details // async logger factory - creates async loggers backed with thread pool. // if a global thread pool doesn't already exist, create it with default queue @@ -36,7 +36,7 @@ template struct async_factory_impl { template - static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) + static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) { // create global thread pool if not already exists.. @@ -45,10 +45,10 @@ struct async_factory_impl if (!details::s_thread_pool) { details::s_thread_pool = std::make_shared(details::default_async_q_size, 1U); - } auto sink = std::make_shared(std::forward(args)...); - auto new_logger = std::make_shared(std::move(logger_name), std::move(sink), std::move(details::s_thread_pool), OverflowPolicy); + auto new_logger = + std::make_shared(std::move(logger_name), std::move(sink), std::move(details::s_thread_pool), OverflowPolicy); return new_logger; } }; @@ -57,13 +57,13 @@ using async_factory = async_factory_impl; using async_factory_nonblock = async_factory_impl; template -inline std::shared_ptr create_async(std::string logger_name, SinkArgs &&...sink_args) +inline std::shared_ptr create_async(std::string logger_name, SinkArgs &&... sink_args) { return async_factory::create(std::move(logger_name), std::forward(sink_args)...); } template -inline std::shared_ptr create_async_nb(std::string logger_name, SinkArgs &&...sink_args) +inline std::shared_ptr create_async_nb(std::string logger_name, SinkArgs &&... sink_args) { return async_factory_nonblock::create(std::move(logger_name), std::forward(sink_args)...); } diff --git a/include/spdlog/common.h b/include/spdlog/common.h index ed0ab46c..5e9fb815 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -262,7 +262,7 @@ namespace details { using std::make_unique; #else template -std::unique_ptr make_unique(Args &&...args) +std::unique_ptr make_unique(Args &&... args) { static_assert(!std::is_array::value, "arrays not supported"); return std::unique_ptr(new T(std::forward(args)...)); diff --git a/include/spdlog/details/synchronous_factory.h b/include/spdlog/details/synchronous_factory.h index 3ff7ba52..b7db290a 100644 --- a/include/spdlog/details/synchronous_factory.h +++ b/include/spdlog/details/synchronous_factory.h @@ -11,7 +11,7 @@ class logger; struct synchronous_factory { template - static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) + static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) { auto sink = std::make_shared(std::forward(args)...); return std::make_shared(std::move(logger_name), std::move(sink)); diff --git a/include/spdlog/details/tcp_client-windows.h b/include/spdlog/details/tcp_client-windows.h index 45b69630..bb99848c 100644 --- a/include/spdlog/details/tcp_client-windows.h +++ b/include/spdlog/details/tcp_client-windows.h @@ -24,7 +24,7 @@ namespace details { class tcp_client { SOCKET socket_ = INVALID_SOCKET; - + static void init_winsock_() { WSADATA wsaData; @@ -55,7 +55,6 @@ public: close(); ::WSACleanup(); } - bool is_connected() const { @@ -65,7 +64,7 @@ public: void close() { ::closesocket(socket_); - socket_ = INVALID_SOCKET; + socket_ = INVALID_SOCKET; } SOCKET fd() const @@ -73,10 +72,9 @@ public: return socket_; } - // try to connect or throw on failure void connect(const std::string &host, int port) - { + { if (is_connected()) { close(); diff --git a/include/spdlog/details/udp_client-windows.h b/include/spdlog/details/udp_client-windows.h index 5cc3dd88..387260f3 100644 --- a/include/spdlog/details/udp_client-windows.h +++ b/include/spdlog/details/udp_client-windows.h @@ -23,7 +23,7 @@ namespace spdlog { namespace details { class udp_client { - static constexpr int TX_BUFFER_SIZE = 1024*10; + static constexpr int TX_BUFFER_SIZE = 1024 * 10; SOCKET socket_ = INVALID_SOCKET; sockaddr_in addr_ = {0}; @@ -64,7 +64,8 @@ public: addr_.sin_family = PF_INET; addr_.sin_port = htons(port); addr_.sin_addr.s_addr = INADDR_ANY; - if (InetPton(PF_INET, TEXT(host.c_str()), &addr_.sin_addr.s_addr) != 1) { + if (InetPton(PF_INET, TEXT(host.c_str()), &addr_.sin_addr.s_addr) != 1) + { int last_error = ::WSAGetLastError(); ::WSACleanup(); throw_winsock_error_("error: Invalid address!", last_error); diff --git a/include/spdlog/details/udp_client.h b/include/spdlog/details/udp_client.h index ccdf2f0b..41236534 100644 --- a/include/spdlog/details/udp_client.h +++ b/include/spdlog/details/udp_client.h @@ -30,7 +30,6 @@ class udp_client int socket_ = -1; struct sockaddr_in sockAddr_; - void cleanup_() { if (socket_ != -1) @@ -58,8 +57,9 @@ public: sockAddr_.sin_family = AF_INET; sockAddr_.sin_port = htons(port); - - if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0) { + + if (::inet_aton(host.c_str(), &sockAddr_.sin_addr) == 0) + { cleanup_(); throw_spdlog_ex("error: Invalid address!"); } @@ -84,7 +84,7 @@ public: ssize_t toslen = 0; socklen_t tolen = sizeof(struct sockaddr); if ((toslen = ::sendto(socket_, data, n_bytes, 0, (struct sockaddr *)&sockAddr_, tolen)) == -1) - { + { throw_spdlog_ex("sendto(2) failed", errno); } } diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h index ddb2935a..07172f6d 100644 --- a/include/spdlog/logger-inl.h +++ b/include/spdlog/logger-inl.h @@ -28,7 +28,6 @@ SPDLOG_INLINE logger::logger(logger &&other) SPDLOG_NOEXCEPT : name_(std::move(o flush_level_(other.flush_level_.load(std::memory_order_relaxed)), custom_err_handler_(std::move(other.custom_err_handler_)) - {} SPDLOG_INLINE logger &logger::operator=(logger other) SPDLOG_NOEXCEPT @@ -135,7 +134,6 @@ SPDLOG_INLINE std::shared_ptr logger::clone(std::string logger_name) return cloned; } - SPDLOG_INLINE void logger::sink_it_(const details::log_msg &msg) { for (auto &sink : sinks_) @@ -168,7 +166,6 @@ SPDLOG_INLINE void logger::flush_() } } - SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg) { auto flush_level = flush_level_.load(std::memory_order_relaxed); diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 2e246ed9..e05a6711 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -30,7 +30,7 @@ # define SPDLOG_LOGGER_CATCH(location) \ catch (const std::exception &ex) \ { \ - if(location.filename) \ + if (location.filename) \ { \ err_handler_(fmt::format("{} [{}({})]", ex.what(), location.filename, location.line)); \ } \ @@ -84,13 +84,13 @@ public: void swap(spdlog::logger &other) SPDLOG_NOEXCEPT; template - void log(source_loc loc, level::level_enum lvl, fmt::format_string fmt, Args &&...args) + void log(source_loc loc, level::level_enum lvl, fmt::format_string fmt, Args &&... args) { log_(loc, lvl, fmt, std::forward(args)...); } template - void log(level::level_enum lvl, fmt::format_string fmt, Args &&...args) + void log(level::level_enum lvl, fmt::format_string fmt, Args &&... args) { log(source_loc{}, lvl, fmt, std::forward(args)...); } @@ -142,86 +142,86 @@ public: } template - void trace(fmt::format_string fmt, Args &&...args) + void trace(fmt::format_string fmt, Args &&... args) { log(level::trace, fmt, std::forward(args)...); } template - void debug(fmt::format_string fmt, Args &&...args) + void debug(fmt::format_string fmt, Args &&... args) { log(level::debug, fmt, std::forward(args)...); } template - void info(fmt::format_string fmt, Args &&...args) + void info(fmt::format_string fmt, Args &&... args) { log(level::info, fmt, std::forward(args)...); } template - void warn(fmt::format_string fmt, Args &&...args) + void warn(fmt::format_string fmt, Args &&... args) { log(level::warn, fmt, std::forward(args)...); } template - void error(fmt::format_string fmt, Args &&...args) + void error(fmt::format_string fmt, Args &&... args) { log(level::err, fmt, std::forward(args)...); } template - void critical(fmt::format_string fmt, Args &&...args) + void critical(fmt::format_string fmt, Args &&... args) { log(level::critical, fmt, std::forward(args)...); } #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT template - void log(level::level_enum lvl, fmt::wformat_string fmt, Args &&...args) + void log(level::level_enum lvl, fmt::wformat_string fmt, Args &&... args) { log(source_loc{}, lvl, fmt, std::forward(args)...); } template - void log(source_loc loc, level::level_enum lvl, fmt::wformat_string fmt, Args &&...args) + void log(source_loc loc, level::level_enum lvl, fmt::wformat_string fmt, Args &&... args) { log_(loc, lvl, fmt, std::forward(args)...); } template - void trace(fmt::wformat_string fmt, Args &&...args) + void trace(fmt::wformat_string fmt, Args &&... args) { log(level::trace, fmt, std::forward(args)...); } template - void debug(fmt::wformat_string fmt, Args &&...args) + void debug(fmt::wformat_string fmt, Args &&... args) { log(level::debug, fmt, std::forward(args)...); } template - void info(fmt::wformat_string fmt, Args &&...args) + void info(fmt::wformat_string fmt, Args &&... args) { log(level::info, fmt, std::forward(args)...); } template - void warn(fmt::wformat_string fmt, Args &&...args) + void warn(fmt::wformat_string fmt, Args &&... args) { log(level::warn, fmt, std::forward(args)...); } template - void error(fmt::wformat_string fmt, Args &&...args) + void error(fmt::wformat_string fmt, Args &&... args) { log(level::err, fmt, std::forward(args)...); } template - void critical(fmt::wformat_string fmt, Args &&...args) + void critical(fmt::wformat_string fmt, Args &&... args) { log(level::critical, fmt, std::forward(args)...); } @@ -304,7 +304,7 @@ protected: // common implementation for after templated public api has been resolved template - void log_(source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&...args) + void log_(source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&... args) { if (!should_log(lvl)) { @@ -322,7 +322,7 @@ protected: #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT template - void log_(source_loc loc, level::level_enum lvl, wstring_view_t fmt, Args &&...args) + void log_(source_loc loc, level::level_enum lvl, wstring_view_t fmt, Args &&... args) { bool log_enabled = should_log(lvl); bool traceback_enabled = tracer_.enabled(); @@ -338,7 +338,7 @@ protected: memory_buf_t buf; details::os::wstr_to_utf8buf(wstring_view_t(wbuf.data(), wbuf.size()), buf); details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); - //log_it_(log_msg, log_enabled, traceback_enabled); + // log_it_(log_msg, log_enabled, traceback_enabled); sink_it_(log_msg); } SPDLOG_LOGGER_CATCH(loc) diff --git a/include/spdlog/pattern_formatter-inl.h b/include/spdlog/pattern_formatter-inl.h index 0dd25849..0429d01c 100644 --- a/include/spdlog/pattern_formatter-inl.h +++ b/include/spdlog/pattern_formatter-inl.h @@ -925,7 +925,6 @@ private: log_clock::time_point last_message_time_; }; - } // namespace details SPDLOG_INLINE pattern_formatter::pattern_formatter( @@ -1289,7 +1288,7 @@ SPDLOG_INLINE void pattern_formatter::compile_pattern_(const std::string &patter } } -SPDLOG_INLINE void set_pattern(logger& logger, std::string pattern) +SPDLOG_INLINE void set_pattern(logger &logger, std::string pattern) { logger.set_formatter(details::make_unique(std::move(pattern))); } diff --git a/include/spdlog/pattern_formatter.h b/include/spdlog/pattern_formatter.h index 4dc4c884..45fd741c 100644 --- a/include/spdlog/pattern_formatter.h +++ b/include/spdlog/pattern_formatter.h @@ -90,7 +90,7 @@ public: void format(const details::log_msg &msg, memory_buf_t &dest) override; template - pattern_formatter &add_flag(char flag, Args &&...args) + pattern_formatter &add_flag(char flag, Args &&... args) { custom_handlers_[flag] = details::make_unique(std::forward(args)...); return *this; @@ -118,9 +118,8 @@ private: void compile_pattern_(const std::string &pattern); }; - // set pattern to logger -SPDLOG_API void set_pattern(logger& logger, std::string pattern); +SPDLOG_API void set_pattern(logger &logger, std::string pattern); } // namespace spdlog diff --git a/include/spdlog/sinks/base_sink-inl.h b/include/spdlog/sinks/base_sink-inl.h index 8c5bce40..2d0bb185 100644 --- a/include/spdlog/sinks/base_sink-inl.h +++ b/include/spdlog/sinks/base_sink-inl.h @@ -43,7 +43,6 @@ void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter(std::unique_pt set_formatter_(std::move(sink_formatter)); } - template void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) { diff --git a/include/spdlog/sinks/qt_sinks.h b/include/spdlog/sinks/qt_sinks.h index 99545665..31b49c60 100644 --- a/include/spdlog/sinks/qt_sinks.h +++ b/include/spdlog/sinks/qt_sinks.h @@ -21,29 +21,36 @@ // namespace spdlog { namespace sinks { -template class qt_sink : public base_sink { +template +class qt_sink : public base_sink +{ public: - qt_sink(QObject *qt_object, const std::string &meta_method) { - qt_object_ = qt_object; - meta_method_ = meta_method; - } + qt_sink(QObject *qt_object, const std::string &meta_method) + { + qt_object_ = qt_object; + meta_method_ = meta_method; + } - ~qt_sink() { flush_(); } + ~qt_sink() + { + flush_(); + } protected: - void sink_it_(const details::log_msg &msg) override { - memory_buf_t formatted; - base_sink::formatter_->format(msg, formatted); - string_view_t str = string_view_t(formatted.data(), formatted.size()); - QMetaObject::invokeMethod(qt_object_, meta_method_.c_str(), Qt::AutoConnection, - Q_ARG(QString, QString::fromUtf8(str.data(), static_cast(str.size())).trimmed())); - } + void sink_it_(const details::log_msg &msg) override + { + memory_buf_t formatted; + base_sink::formatter_->format(msg, formatted); + string_view_t str = string_view_t(formatted.data(), formatted.size()); + QMetaObject::invokeMethod(qt_object_, meta_method_.c_str(), Qt::AutoConnection, + Q_ARG(QString, QString::fromUtf8(str.data(), static_cast(str.size())).trimmed())); + } - void flush_() override {} + void flush_() override {} private: - QObject *qt_object_ = nullptr; - std::string meta_method_; + QObject *qt_object_ = nullptr; + std::string meta_method_; }; #include "spdlog/details/null_mutex.h" @@ -55,39 +62,41 @@ using qt_sink_st = qt_sink; // // Factory functions // -template -inline std::shared_ptr -qt_logger_mt(const std::string &logger_name, QTextEdit* qt_object, const std::string &meta_method = "append") { - return Factory::template create(logger_name, qt_object, meta_method); +template +inline std::shared_ptr qt_logger_mt(const std::string &logger_name, QTextEdit *qt_object, const std::string &meta_method = "append") +{ + return Factory::template create(logger_name, qt_object, meta_method); } -template -inline std::shared_ptr -qt_logger_st(const std::string &logger_name, QTextEdit* qt_object, const std::string &meta_method = "append") { - return Factory::template create(logger_name, qt_object, meta_method); +template +inline std::shared_ptr qt_logger_st(const std::string &logger_name, QTextEdit *qt_object, const std::string &meta_method = "append") +{ + return Factory::template create(logger_name, qt_object, meta_method); } -template -inline std::shared_ptr -qt_logger_mt(const std::string &logger_name, QPlainTextEdit* qt_object , const std::string &meta_method = "appendPlainText") { +template +inline std::shared_ptr qt_logger_mt( + const std::string &logger_name, QPlainTextEdit *qt_object, const std::string &meta_method = "appendPlainText") +{ return Factory::template create(logger_name, qt_object, meta_method); } -template -inline std::shared_ptr -qt_logger_st(const std::string &logger_name, QPlainTextEdit* qt_object, const std::string &meta_method = "appendPlainText") { +template +inline std::shared_ptr qt_logger_st( + const std::string &logger_name, QPlainTextEdit *qt_object, const std::string &meta_method = "appendPlainText") +{ return Factory::template create(logger_name, qt_object, meta_method); } -template -inline std::shared_ptr -qt_logger_mt(const std::string &logger_name, QObject* qt_object, const std::string &meta_method) { +template +inline std::shared_ptr qt_logger_mt(const std::string &logger_name, QObject *qt_object, const std::string &meta_method) +{ return Factory::template create(logger_name, qt_object, meta_method); } -template -inline std::shared_ptr -qt_logger_st(const std::string &logger_name, QObject* qt_object, const std::string &meta_method) { +template +inline std::shared_ptr qt_logger_st(const std::string &logger_name, QObject *qt_object, const std::string &meta_method) +{ return Factory::template create(logger_name, qt_object, meta_method); } } // namespace spdlog diff --git a/include/spdlog/sinks/udp_sink.h b/include/spdlog/sinks/udp_sink.h index 934f6686..ccbce2be 100644 --- a/include/spdlog/sinks/udp_sink.h +++ b/include/spdlog/sinks/udp_sink.h @@ -53,7 +53,7 @@ protected: client_.send(formatted.data(), formatted.size()); } - void flush_() override {} + void flush_() override {} details::udp_client client_; }; diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index 663c3b98..33e5cd82 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -84,7 +84,6 @@ void SPDLOG_INLINE wincolor_sink::flush() // windows console always flushed? } - template void SPDLOG_INLINE wincolor_sink::set_formatter(std::unique_ptr sink_formatter) { diff --git a/include/spdlog/spdlog-inl.h b/include/spdlog/spdlog-inl.h index dcf7233a..bb7248bb 100644 --- a/include/spdlog/spdlog-inl.h +++ b/include/spdlog/spdlog-inl.h @@ -12,7 +12,7 @@ namespace spdlog { -SPDLOG_INLINE std::shared_ptr& default_logger() +SPDLOG_INLINE std::shared_ptr &default_logger() { static auto s_default_logger = stdout_color_mt(""); return s_default_logger; diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 8433bf4c..cd7ca178 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -30,7 +30,7 @@ using default_factory = synchronous_factory; // Example: // spdlog::create("logger_name", "dailylog_filename", 11, 59); template -inline std::shared_ptr create(std::string logger_name, SinkArgs &&...sink_args) +inline std::shared_ptr create(std::string logger_name, SinkArgs &&... sink_args) { return default_factory::create(std::move(logger_name), std::forward(sink_args)...); } @@ -53,51 +53,50 @@ inline std::shared_ptr create(std::string logger_name, SinkArgs SPDLOG_API std::shared_ptr &default_logger(); SPDLOG_API void set_default_logger(std::shared_ptr default_logger); - template -inline void log(source_loc source, level::level_enum lvl, fmt::format_string fmt, Args &&...args) +inline void log(source_loc source, level::level_enum lvl, fmt::format_string fmt, Args &&... args) { default_logger()->log(source, lvl, fmt, std::forward(args)...); } template -inline void log(level::level_enum lvl, fmt::format_string fmt, Args &&...args) +inline void log(level::level_enum lvl, fmt::format_string fmt, Args &&... args) { default_logger()->log(source_loc{}, lvl, fmt, std::forward(args)...); } template -inline void trace(fmt::format_string fmt, Args &&...args) +inline void trace(fmt::format_string fmt, Args &&... args) { default_logger()->trace(fmt, std::forward(args)...); } template -inline void debug(fmt::format_string fmt, Args &&...args) +inline void debug(fmt::format_string fmt, Args &&... args) { default_logger()->debug(fmt, std::forward(args)...); } template -inline void info(fmt::format_string fmt, Args &&...args) +inline void info(fmt::format_string fmt, Args &&... args) { default_logger()->info(fmt, std::forward(args)...); } template -inline void warn(fmt::format_string fmt, Args &&...args) +inline void warn(fmt::format_string fmt, Args &&... args) { default_logger()->warn(fmt, std::forward(args)...); } template -inline void error(fmt::format_string fmt, Args &&...args) +inline void error(fmt::format_string fmt, Args &&... args) { default_logger()->error(fmt, std::forward(args)...); } template -inline void critical(fmt::format_string fmt, Args &&...args) +inline void critical(fmt::format_string fmt, Args &&... args) { default_logger()->critical(fmt, std::forward(args)...); } @@ -116,49 +115,49 @@ inline void log(level::level_enum lvl, const T &msg) #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT template -inline void log(source_loc source, level::level_enum lvl, fmt::wformat_string fmt, Args &&...args) +inline void log(source_loc source, level::level_enum lvl, fmt::wformat_string fmt, Args &&... args) { default_logger()->log(source, lvl, fmt, std::forward(args)...); } template -inline void log(level::level_enum lvl, fmt::wformat_string fmt, Args &&...args) +inline void log(level::level_enum lvl, fmt::wformat_string fmt, Args &&... args) { default_logger()->log(source_loc{}, lvl, fmt, std::forward(args)...); } template -inline void trace(fmt::wformat_string fmt, Args &&...args) +inline void trace(fmt::wformat_string fmt, Args &&... args) { default_logger()->trace(fmt, std::forward(args)...); } template -inline void debug(fmt::wformat_string fmt, Args &&...args) +inline void debug(fmt::wformat_string fmt, Args &&... args) { default_logger()->debug(fmt, std::forward(args)...); } template -inline void info(fmt::wformat_string fmt, Args &&...args) +inline void info(fmt::wformat_string fmt, Args &&... args) { default_logger()->info(fmt, std::forward(args)...); } template -inline void warn(fmt::wformat_string fmt, Args &&...args) +inline void warn(fmt::wformat_string fmt, Args &&... args) { default_logger()->warn(fmt, std::forward(args)...); } template -inline void error(fmt::wformat_string fmt, Args &&...args) +inline void error(fmt::wformat_string fmt, Args &&... args) { default_logger()->error(fmt, std::forward(args)...); } template -inline void critical(fmt::wformat_string fmt, Args &&...args) +inline void critical(fmt::wformat_string fmt, Args &&... args) { default_logger()->critical(fmt, std::forward(args)...); } diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index 6fd8123d..22b904e1 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -5,7 +5,7 @@ using spdlog::memory_buf_t; // log to str and return it template -static std::string log_to_str(const std::string &msg, const Args &...args) +static std::string log_to_str(const std::string &msg, const Args &... args) { std::ostringstream oss; auto oss_sink = std::make_shared(oss);