diff --git a/bench/async_bench.cpp b/bench/async_bench.cpp index 64606414..df5cbdc5 100644 --- a/bench/async_bench.cpp +++ b/bench/async_bench.cpp @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) if (argc > 3) { queue_size = atoi(argv[3]); - if(queue_size > 500000) + if (queue_size > 500000) { spdlog::error("Max queue size allowed: 500,000"); exit(1); @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) spdlog::info("Messages : {:n}", howmany); spdlog::info("Threads : {:n}", threads); spdlog::info("Queue : {:n} slots", queue_size); - spdlog::info("Queue memory : {:n} x {} = {:n} KB ", queue_size, slot_size, (queue_size * slot_size)/1024); + spdlog::info("Queue memory : {:n} x {} = {:n} KB ", queue_size, slot_size, (queue_size * slot_size) / 1024); spdlog::info("Total iters : {:n}", iters); spdlog::info("-------------------------------------------------"); diff --git a/bench/bench.cpp b/bench/bench.cpp index d163381c..d21dcdc1 100644 --- a/bench/bench.cpp +++ b/bench/bench.cpp @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) spdlog::info("Messages: {:n}", howmany); spdlog::info("Queue size: {:n} slots", queue_size); auto slot_size = sizeof(spdlog::details::async_msg); - spdlog::info("Total queue memory: {}x{} bytes per slot = {:n} Kb ", queue_size, slot_size, (queue_size * slot_size)/1024); + spdlog::info("Total queue memory: {}x{} bytes per slot = {:n} Kb ", queue_size, slot_size, (queue_size * slot_size) / 1024); spdlog::info("**************************************************************"); for (int i = 0; i < iters; ++i) diff --git a/include/spdlog/async.h b/include/spdlog/async.h index a13cbdc7..0c5e07ae 100644 --- a/include/spdlog/async.h +++ b/include/spdlog/async.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/async_logger-inl.h b/include/spdlog/async_logger-inl.h index ce2e8d2b..5c3b0e37 100644 --- a/include/spdlog/async_logger-inl.h +++ b/include/spdlog/async_logger-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 9651da4d..c6309360 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/common-inl.h b/include/spdlog/common-inl.h index 6076b8cb..95fedcd0 100644 --- a/include/spdlog/common-inl.h +++ b/include/spdlog/common-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 47f79bdc..fdd887b7 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -223,7 +223,6 @@ std::unique_ptr make_unique(Args &&... args) #endif } // namespace details - } // namespace spdlog #ifdef SPDLOG_HEADER_ONLY diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index b6324e06..4db554c0 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) // cirucal q view of std::vector. diff --git a/include/spdlog/details/console_globals.h b/include/spdlog/details/console_globals.h index 85ff9023..9fe8adc8 100644 --- a/include/spdlog/details/console_globals.h +++ b/include/spdlog/details/console_globals.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/file_helper-inl.h b/include/spdlog/details/file_helper-inl.h index 1460fc2b..19f7a8c8 100644 --- a/include/spdlog/details/file_helper-inl.h +++ b/include/spdlog/details/file_helper-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/file_helper.h b/include/spdlog/details/file_helper.h index 70ff03b9..6fdecd06 100644 --- a/include/spdlog/details/file_helper.h +++ b/include/spdlog/details/file_helper.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/fmt_helper.h b/include/spdlog/details/fmt_helper.h index da253720..773ad236 100644 --- a/include/spdlog/details/fmt_helper.h +++ b/include/spdlog/details/fmt_helper.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/log_msg-inl.h b/include/spdlog/details/log_msg-inl.h index 0df717f9..caa5f37a 100644 --- a/include/spdlog/details/log_msg-inl.h +++ b/include/spdlog/details/log_msg-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/log_msg.h b/include/spdlog/details/log_msg.h index b6963af4..d4183c1e 100644 --- a/include/spdlog/details/log_msg.h +++ b/include/spdlog/details/log_msg.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/mpmc_blocking_q.h b/include/spdlog/details/mpmc_blocking_q.h index 4d162d83..d8a1efe2 100644 --- a/include/spdlog/details/mpmc_blocking_q.h +++ b/include/spdlog/details/mpmc_blocking_q.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/null_mutex.h b/include/spdlog/details/null_mutex.h index aa54f79a..d1062db7 100644 --- a/include/spdlog/details/null_mutex.h +++ b/include/spdlog/details/null_mutex.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index b7f66f41..e0809d9b 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -371,8 +371,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT #ifdef _WIN32 return true; #else - static constexpr std::arrayTerms = { - "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}; + static constexpr std::array Terms = { + "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}; const char *env_p = std::getenv("TERM"); if (env_p == nullptr) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 3197ec69..4afe0cb9 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/pattern_formatter-inl.h b/include/spdlog/details/pattern_formatter-inl.h index 9153175a..0a040115 100644 --- a/include/spdlog/details/pattern_formatter-inl.h +++ b/include/spdlog/details/pattern_formatter-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -163,7 +163,7 @@ static int to12h(const tm &t) } // Abbreviated weekday name -static std::array days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; +static std::array days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; class a_formatter : public flag_formatter { public: @@ -197,7 +197,7 @@ public: }; // Abbreviated month -static const std::array months {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}; +static const std::array months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}; class b_formatter : public flag_formatter { public: @@ -214,8 +214,8 @@ public: }; // Full month name -static const std::array full_months { - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; +static const std::array full_months{ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; class B_formatter : public flag_formatter { @@ -305,7 +305,8 @@ class Y_formatter final : public flag_formatter { public: explicit Y_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -368,7 +369,8 @@ class I_formatter final : public flag_formatter { public: explicit I_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -383,7 +385,8 @@ class M_formatter final : public flag_formatter { public: explicit M_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -398,7 +401,8 @@ class S_formatter final : public flag_formatter { public: explicit S_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -413,7 +417,8 @@ class e_formatter final : public flag_formatter { public: explicit e_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -436,7 +441,8 @@ class f_formatter final : public flag_formatter { public: explicit f_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -459,7 +465,8 @@ class F_formatter final : public flag_formatter { public: explicit F_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -482,7 +489,8 @@ class E_formatter final : public flag_formatter { public: explicit E_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -499,7 +507,8 @@ class p_formatter final : public flag_formatter { public: explicit p_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -514,7 +523,8 @@ class r_formatter final : public flag_formatter { public: explicit r_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -536,7 +546,8 @@ class R_formatter final : public flag_formatter { public: explicit R_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -554,7 +565,8 @@ class T_formatter final : public flag_formatter { public: explicit T_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override { @@ -574,9 +586,8 @@ class z_formatter final : public flag_formatter { public: explicit z_formatter(padding_info padinfo) - : flag_formatter(padinfo){} - - + : flag_formatter(padinfo) + {} z_formatter() = default; z_formatter(const z_formatter &) = delete; @@ -634,7 +645,8 @@ class t_formatter final : public flag_formatter { public: explicit t_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -656,7 +668,8 @@ class pid_formatter final : public flag_formatter { public: explicit pid_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &, const std::tm &, fmt::memory_buffer &dest) override { @@ -678,7 +691,8 @@ class v_formatter final : public flag_formatter { public: explicit v_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -762,7 +776,8 @@ class source_location_formatter final : public flag_formatter { public: explicit source_location_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -791,7 +806,8 @@ class source_filename_formatter final : public flag_formatter { public: explicit source_filename_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -808,7 +824,8 @@ class source_linenum_formatter final : public flag_formatter { public: explicit source_linenum_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { @@ -833,7 +850,8 @@ class source_funcname_formatter final : public flag_formatter { public: explicit source_funcname_formatter(padding_info padinfo) - : flag_formatter(padinfo){} + : flag_formatter(padinfo) + {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override { diff --git a/include/spdlog/details/pattern_formatter.h b/include/spdlog/details/pattern_formatter.h index b6052c1b..f13759ad 100644 --- a/include/spdlog/details/pattern_formatter.h +++ b/include/spdlog/details/pattern_formatter.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/periodic_worker-inl.h b/include/spdlog/details/periodic_worker-inl.h index f97ed4d1..1af6288a 100644 --- a/include/spdlog/details/periodic_worker-inl.h +++ b/include/spdlog/details/periodic_worker-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/periodic_worker.h b/include/spdlog/details/periodic_worker.h index 24b9b96c..d3b5c639 100644 --- a/include/spdlog/details/periodic_worker.h +++ b/include/spdlog/details/periodic_worker.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/registry-inl.h b/include/spdlog/details/registry-inl.h index 9ea46237..ffecfedb 100644 --- a/include/spdlog/details/registry-inl.h +++ b/include/spdlog/details/registry-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index 4070fa82..f96a7698 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/synchronous_factory.h b/include/spdlog/details/synchronous_factory.h index 2e9c1e41..68f5c214 100644 --- a/include/spdlog/details/synchronous_factory.h +++ b/include/spdlog/details/synchronous_factory.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -8,15 +8,17 @@ namespace spdlog { // Default logger factory- creates synchronous loggers - class logger; +class logger; - struct synchronous_factory { - template - static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) { - auto sink = std::make_shared(std::forward(args)...); - auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); - details::registry::instance().initialize_logger(new_logger); - return new_logger; - } - }; -} \ No newline at end of file +struct synchronous_factory +{ + template + static std::shared_ptr create(std::string logger_name, SinkArgs &&... args) + { + auto sink = std::make_shared(std::forward(args)...); + auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); + details::registry::instance().initialize_logger(new_logger); + return new_logger; + } +}; +} // namespace spdlog \ No newline at end of file diff --git a/include/spdlog/details/thread_pool-inl.h b/include/spdlog/details/thread_pool-inl.h index 61b94380..46c9cc44 100644 --- a/include/spdlog/details/thread_pool-inl.h +++ b/include/spdlog/details/thread_pool-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index 9cbab356..3923ffbe 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/formatter.h b/include/spdlog/formatter.h index 16d86969..b133f6e9 100644 --- a/include/spdlog/formatter.h +++ b/include/spdlog/formatter.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h index 374376be..d669c632 100644 --- a/include/spdlog/logger-inl.h +++ b/include/spdlog/logger-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 0065bf9f..c309b976 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -32,9 +32,9 @@ class logger { public: // Empty logger - explicit logger(std::string name) : - name_(std::move(name)), - sinks_() + explicit logger(std::string name) + : name_(std::move(name)) + , sinks_() {} // Logger with range on sinks @@ -54,8 +54,6 @@ public: : logger(std::move(name), sinks.begin(), sinks.end()) {} - - virtual ~logger() = default; logger(const logger &) = delete; diff --git a/include/spdlog/sinks/android_sink.h b/include/spdlog/sinks/android_sink.h index f2b7a683..701c0e95 100644 --- a/include/spdlog/sinks/android_sink.h +++ b/include/spdlog/sinks/android_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/ansicolor_sink-inl.h b/include/spdlog/sinks/ansicolor_sink-inl.h index c7c3fa2d..2acb0a2d 100644 --- a/include/spdlog/sinks/ansicolor_sink-inl.h +++ b/include/spdlog/sinks/ansicolor_sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -93,15 +93,15 @@ SPDLOG_INLINE void spdlog::sinks::ansicolor_sink::se { switch (mode) { - case color_mode::always: - should_do_colors_ = true; - return; - case color_mode::automatic: - should_do_colors_ = details::os::in_terminal(target_file_) && details::os::is_color_terminal(); - return; - case color_mode::never: - should_do_colors_ = false; - return; + case color_mode::always: + should_do_colors_ = true; + return; + case color_mode::automatic: + should_do_colors_ = details::os::in_terminal(target_file_) && details::os::is_color_terminal(); + return; + case color_mode::never: + should_do_colors_ = false; + return; } } diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index 11ffd7fa..a25fecb8 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -77,7 +77,6 @@ private: void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end); }; - using ansicolor_stdout_sink_mt = ansicolor_sink; using ansicolor_stdout_sink_st = ansicolor_sink; diff --git a/include/spdlog/sinks/base_sink-inl.h b/include/spdlog/sinks/base_sink-inl.h index 4ee23439..553f2515 100644 --- a/include/spdlog/sinks/base_sink-inl.h +++ b/include/spdlog/sinks/base_sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/base_sink.h b/include/spdlog/sinks/base_sink.h index c9f5670e..63010afa 100644 --- a/include/spdlog/sinks/base_sink.h +++ b/include/spdlog/sinks/base_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/basic_file_sink-inl.h b/include/spdlog/sinks/basic_file_sink-inl.h index 254e5085..6683eeba 100644 --- a/include/spdlog/sinks/basic_file_sink-inl.h +++ b/include/spdlog/sinks/basic_file_sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/basic_file_sink.h b/include/spdlog/sinks/basic_file_sink.h index 366dba8e..899b89fa 100644 --- a/include/spdlog/sinks/basic_file_sink.h +++ b/include/spdlog/sinks/basic_file_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index e3f17864..8c907171 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/dist_sink.h b/include/spdlog/sinks/dist_sink.h index e2d7f880..45ffa143 100644 --- a/include/spdlog/sinks/dist_sink.h +++ b/include/spdlog/sinks/dist_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/null_sink.h b/include/spdlog/sinks/null_sink.h index fd78a5ec..857e31f2 100644 --- a/include/spdlog/sinks/null_sink.h +++ b/include/spdlog/sinks/null_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/ostream_sink.h b/include/spdlog/sinks/ostream_sink.h index ababc446..a2a5a3a3 100644 --- a/include/spdlog/sinks/ostream_sink.h +++ b/include/spdlog/sinks/ostream_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index f871c820..588619f8 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/rotating_file_sink.h b/include/spdlog/sinks/rotating_file_sink.h index 6286eb6a..45fa3bd1 100644 --- a/include/spdlog/sinks/rotating_file_sink.h +++ b/include/spdlog/sinks/rotating_file_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/sink-inl.h b/include/spdlog/sinks/sink-inl.h index 52227696..11b77fc9 100644 --- a/include/spdlog/sinks/sink-inl.h +++ b/include/spdlog/sinks/sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/sink.h b/include/spdlog/sinks/sink.h index 263cbe5b..f9703fdf 100644 --- a/include/spdlog/sinks/sink.h +++ b/include/spdlog/sinks/sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/stdout_color_sinks-inl.h b/include/spdlog/sinks/stdout_color_sinks-inl.h index 56314c15..0effb4db 100644 --- a/include/spdlog/sinks/stdout_color_sinks-inl.h +++ b/include/spdlog/sinks/stdout_color_sinks-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/stdout_color_sinks.h b/include/spdlog/sinks/stdout_color_sinks.h index 6a9795f7..d11ec0a1 100644 --- a/include/spdlog/sinks/stdout_color_sinks.h +++ b/include/spdlog/sinks/stdout_color_sinks.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -26,7 +26,6 @@ using stderr_color_sink_st = ansicolor_stderr_sink_st; #endif } // namespace sinks - template std::shared_ptr stdout_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); diff --git a/include/spdlog/sinks/stdout_sinks.h b/include/spdlog/sinks/stdout_sinks.h index 117142c8..d313a249 100644 --- a/include/spdlog/sinks/stdout_sinks.h +++ b/include/spdlog/sinks/stdout_sinks.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 53caff5e..cd59e143 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index e107d1a2..1611e2c2 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once @@ -91,15 +91,15 @@ void SPDLOG_INLINE wincolor_sink::set_color_mode(col { switch (mode) { - case color_mode::always: - case color_mode::automatic: - should_do_colors_ = true; - break; - case color_mode::never: - should_do_colors_ = false; - break; - default: - should_do_colors_ = true; + case color_mode::always: + case color_mode::automatic: + should_do_colors_ = true; + break; + case color_mode::never: + should_do_colors_ = false; + break; + default: + should_do_colors_ = true; } } diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h index 73939796..d8b2b715 100644 --- a/include/spdlog/sinks/wincolor_sink.h +++ b/include/spdlog/sinks/wincolor_sink.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/spdlog-inl.h b/include/spdlog/spdlog-inl.h index c8aa1c8e..5f6c8fb1 100644 --- a/include/spdlog/spdlog-inl.h +++ b/include/spdlog/spdlog-inl.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index ce32bc6e..fa4c9649 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) // spdlog main header file. diff --git a/include/spdlog/tweakme.h b/include/spdlog/tweakme.h index a2705798..2f3241b8 100644 --- a/include/spdlog/tweakme.h +++ b/include/spdlog/tweakme.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/include/spdlog/version.h b/include/spdlog/version.h index 0bbf338d..4c33fdf9 100644 --- a/include/spdlog/version.h +++ b/include/spdlog/version.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 2633cfb9..d888dc4f 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -1,4 +1,4 @@ -// Copyright(c) 2015-present Gabi Melman & spdlog contributors. +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #ifndef SPDLOG_COMPILED_LIB @@ -58,10 +58,14 @@ template class spdlog::sinks::ansicolor_sink spdlog::stdout_color_mt(const std::string &logger_name, color_mode mode); -template std::shared_ptr spdlog::stdout_color_st(const std::string &logger_name, color_mode mode); -template std::shared_ptr spdlog::stderr_color_mt(const std::string &logger_name, color_mode mode); -template std::shared_ptr spdlog::stderr_color_st(const std::string &logger_name, color_mode mode); +template std::shared_ptr spdlog::stdout_color_mt( + const std::string &logger_name, color_mode mode); +template std::shared_ptr spdlog::stdout_color_st( + const std::string &logger_name, color_mode mode); +template std::shared_ptr spdlog::stderr_color_mt( + const std::string &logger_name, color_mode mode); +template std::shared_ptr spdlog::stderr_color_st( + const std::string &logger_name, color_mode mode); template std::shared_ptr spdlog::stdout_color_mt(const std::string &logger_name, color_mode mode); template std::shared_ptr spdlog::stdout_color_st(const std::string &logger_name, color_mode mode);