Commit bcfa9241 authored by gabime's avatar gabime

Updated copyright headers

parent eea9d613
...@@ -64,7 +64,7 @@ int main(int argc, char *argv[]) ...@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
if (argc > 3) if (argc > 3)
{ {
queue_size = atoi(argv[3]); queue_size = atoi(argv[3]);
if(queue_size > 500000) if (queue_size > 500000)
{ {
spdlog::error("Max queue size allowed: 500,000"); spdlog::error("Max queue size allowed: 500,000");
exit(1); exit(1);
...@@ -79,7 +79,7 @@ int main(int argc, char *argv[]) ...@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
spdlog::info("Messages : {:n}", howmany); spdlog::info("Messages : {:n}", howmany);
spdlog::info("Threads : {:n}", threads); spdlog::info("Threads : {:n}", threads);
spdlog::info("Queue : {:n} slots", queue_size); 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("Total iters : {:n}", iters);
spdlog::info("-------------------------------------------------"); spdlog::info("-------------------------------------------------");
......
...@@ -102,7 +102,7 @@ int main(int argc, char *argv[]) ...@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
spdlog::info("Messages: {:n}", howmany); spdlog::info("Messages: {:n}", howmany);
spdlog::info("Queue size: {:n} slots", queue_size); spdlog::info("Queue size: {:n} slots", queue_size);
auto slot_size = sizeof(spdlog::details::async_msg); 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("**************************************************************"); spdlog::info("**************************************************************");
for (int i = 0; i < iters; ++i) for (int i = 0; i < iters; ++i)
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -223,7 +223,6 @@ std::unique_ptr<T> make_unique(Args &&... args) ...@@ -223,7 +223,6 @@ std::unique_ptr<T> make_unique(Args &&... args)
#endif #endif
} // namespace details } // namespace details
} // namespace spdlog } // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY #ifdef SPDLOG_HEADER_ONLY
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
// cirucal q view of std::vector. // cirucal q view of std::vector.
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -371,8 +371,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT ...@@ -371,8 +371,8 @@ SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT
#ifdef _WIN32 #ifdef _WIN32
return true; return true;
#else #else
static constexpr std::array<const char *, 14>Terms = { static constexpr std::array<const char *, 14> Terms = {
"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"}; "ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys", "putty", "rxvt", "screen", "vt100", "xterm"};
const char *env_p = std::getenv("TERM"); const char *env_p = std::getenv("TERM");
if (env_p == nullptr) if (env_p == nullptr)
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -163,7 +163,7 @@ static int to12h(const tm &t) ...@@ -163,7 +163,7 @@ static int to12h(const tm &t)
} }
// Abbreviated weekday name // Abbreviated weekday name
static std::array<const char*, 7> days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static std::array<const char *, 7> days{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
class a_formatter : public flag_formatter class a_formatter : public flag_formatter
{ {
public: public:
...@@ -197,7 +197,7 @@ public: ...@@ -197,7 +197,7 @@ public:
}; };
// Abbreviated month // Abbreviated month
static const std::array<const char *, 12> months {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}; static const std::array<const char *, 12> months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
class b_formatter : public flag_formatter class b_formatter : public flag_formatter
{ {
public: public:
...@@ -214,8 +214,8 @@ public: ...@@ -214,8 +214,8 @@ public:
}; };
// Full month name // Full month name
static const std::array<const char *, 12> full_months { static const std::array<const char *, 12> full_months{
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
class B_formatter : public flag_formatter class B_formatter : public flag_formatter
{ {
...@@ -305,7 +305,8 @@ class Y_formatter final : public flag_formatter ...@@ -305,7 +305,8 @@ class Y_formatter final : public flag_formatter
{ {
public: public:
explicit Y_formatter(padding_info padinfo) 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 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 ...@@ -368,7 +369,8 @@ class I_formatter final : public flag_formatter
{ {
public: public:
explicit I_formatter(padding_info padinfo) 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 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 ...@@ -383,7 +385,8 @@ class M_formatter final : public flag_formatter
{ {
public: public:
explicit M_formatter(padding_info padinfo) 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 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 ...@@ -398,7 +401,8 @@ class S_formatter final : public flag_formatter
{ {
public: public:
explicit S_formatter(padding_info padinfo) 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 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 ...@@ -413,7 +417,8 @@ class e_formatter final : public flag_formatter
{ {
public: public:
explicit e_formatter(padding_info padinfo) 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 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 ...@@ -436,7 +441,8 @@ class f_formatter final : public flag_formatter
{ {
public: public:
explicit f_formatter(padding_info padinfo) 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 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 ...@@ -459,7 +465,8 @@ class F_formatter final : public flag_formatter
{ {
public: public:
explicit F_formatter(padding_info padinfo) 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 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 ...@@ -482,7 +489,8 @@ class E_formatter final : public flag_formatter
{ {
public: public:
explicit E_formatter(padding_info padinfo) 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 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 ...@@ -499,7 +507,8 @@ class p_formatter final : public flag_formatter
{ {
public: public:
explicit p_formatter(padding_info padinfo) 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 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 ...@@ -514,7 +523,8 @@ class r_formatter final : public flag_formatter
{ {
public: public:
explicit r_formatter(padding_info padinfo) 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 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 ...@@ -536,7 +546,8 @@ class R_formatter final : public flag_formatter
{ {
public: public:
explicit R_formatter(padding_info padinfo) 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 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 ...@@ -554,7 +565,8 @@ class T_formatter final : public flag_formatter
{ {
public: public:
explicit T_formatter(padding_info padinfo) 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 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 ...@@ -574,9 +586,8 @@ class z_formatter final : public flag_formatter
{ {
public: public:
explicit z_formatter(padding_info padinfo) explicit z_formatter(padding_info padinfo)
: flag_formatter(padinfo){} : flag_formatter(padinfo)
{}
z_formatter() = default; z_formatter() = default;
z_formatter(const z_formatter &) = delete; z_formatter(const z_formatter &) = delete;
...@@ -634,7 +645,8 @@ class t_formatter final : public flag_formatter ...@@ -634,7 +645,8 @@ class t_formatter final : public flag_formatter
{ {
public: public:
explicit t_formatter(padding_info padinfo) 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 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 ...@@ -656,7 +668,8 @@ class pid_formatter final : public flag_formatter
{ {
public: public:
explicit pid_formatter(padding_info padinfo) 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 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 ...@@ -678,7 +691,8 @@ class v_formatter final : public flag_formatter
{ {
public: public:
explicit v_formatter(padding_info padinfo) 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 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 ...@@ -762,7 +776,8 @@ class source_location_formatter final : public flag_formatter
{ {
public: public:
explicit source_location_formatter(padding_info padinfo) 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 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 ...@@ -791,7 +806,8 @@ class source_filename_formatter final : public flag_formatter
{ {
public: public:
explicit source_filename_formatter(padding_info padinfo) 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 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 ...@@ -808,7 +824,8 @@ class source_linenum_formatter final : public flag_formatter
{ {
public: public:
explicit source_linenum_formatter(padding_info padinfo) 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 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 ...@@ -833,7 +850,8 @@ class source_funcname_formatter final : public flag_formatter
{ {
public: public:
explicit source_funcname_formatter(padding_info padinfo) 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 void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
{ {
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -8,15 +8,17 @@ ...@@ -8,15 +8,17 @@
namespace spdlog { namespace spdlog {
// Default logger factory- creates synchronous loggers // Default logger factory- creates synchronous loggers
class logger; class logger;
struct synchronous_factory { struct synchronous_factory
template<typename Sink, typename... SinkArgs> {
static std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs &&... args) { template<typename Sink, typename... SinkArgs>
auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...); static std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs &&... args)
auto new_logger = std::make_shared<spdlog::logger>(std::move(logger_name), std::move(sink)); {
details::registry::instance().initialize_logger(new_logger); auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...);
return new_logger; auto new_logger = std::make_shared<spdlog::logger>(std::move(logger_name), std::move(sink));
} details::registry::instance().initialize_logger(new_logger);
}; return new_logger;
} }
\ No newline at end of file };
} // namespace spdlog
\ No newline at end of file
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -32,9 +32,9 @@ class logger ...@@ -32,9 +32,9 @@ class logger
{ {
public: public:
// Empty logger // Empty logger
explicit logger(std::string name) : explicit logger(std::string name)
name_(std::move(name)), : name_(std::move(name))
sinks_() , sinks_()
{} {}
// Logger with range on sinks // Logger with range on sinks
...@@ -54,8 +54,6 @@ public: ...@@ -54,8 +54,6 @@ public:
: logger(std::move(name), sinks.begin(), sinks.end()) : logger(std::move(name), sinks.begin(), sinks.end())
{} {}
virtual ~logger() = default; virtual ~logger() = default;
logger(const logger &) = delete; logger(const logger &) = delete;
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -93,15 +93,15 @@ SPDLOG_INLINE void spdlog::sinks::ansicolor_sink<TargetStream, ConsoleMutex>::se ...@@ -93,15 +93,15 @@ SPDLOG_INLINE void spdlog::sinks::ansicolor_sink<TargetStream, ConsoleMutex>::se
{ {
switch (mode) switch (mode)
{ {
case color_mode::always: case color_mode::always:
should_do_colors_ = true; should_do_colors_ = true;
return; return;
case color_mode::automatic: case color_mode::automatic:
should_do_colors_ = details::os::in_terminal(target_file_) && details::os::is_color_terminal(); should_do_colors_ = details::os::in_terminal(target_file_) && details::os::is_color_terminal();
return; return;
case color_mode::never: case color_mode::never:
should_do_colors_ = false; should_do_colors_ = false;
return; return;
} }
} }
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -77,7 +77,6 @@ private: ...@@ -77,7 +77,6 @@ private:
void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end); void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end);
}; };
using ansicolor_stdout_sink_mt = ansicolor_sink<details::console_stdout, details::console_mutex>; using ansicolor_stdout_sink_mt = ansicolor_sink<details::console_stdout, details::console_mutex>;
using ansicolor_stdout_sink_st = ansicolor_sink<details::console_stdout, details::console_nullmutex>; using ansicolor_stdout_sink_st = ansicolor_sink<details::console_stdout, details::console_nullmutex>;
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -26,7 +26,6 @@ using stderr_color_sink_st = ansicolor_stderr_sink_st; ...@@ -26,7 +26,6 @@ using stderr_color_sink_st = ansicolor_stderr_sink_st;
#endif #endif
} // namespace sinks } // namespace sinks
template<typename Factory = spdlog::synchronous_factory> template<typename Factory = spdlog::synchronous_factory>
std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic);
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
...@@ -91,15 +91,15 @@ void SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::set_color_mode(col ...@@ -91,15 +91,15 @@ void SPDLOG_INLINE wincolor_sink<TargetStream, ConsoleMutex>::set_color_mode(col
{ {
switch (mode) switch (mode)
{ {
case color_mode::always: case color_mode::always:
case color_mode::automatic: case color_mode::automatic:
should_do_colors_ = true; should_do_colors_ = true;
break; break;
case color_mode::never: case color_mode::never:
should_do_colors_ = false; should_do_colors_ = false;
break; break;
default: default:
should_do_colors_ = true; should_do_colors_ = true;
} }
} }
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
// spdlog main header file. // spdlog main header file.
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#pragma once #pragma once
......
// 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) // Distributed under the MIT License (http://opensource.org/licenses/MIT)
#ifndef SPDLOG_COMPILED_LIB #ifndef SPDLOG_COMPILED_LIB
...@@ -58,10 +58,14 @@ template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stderr, sp ...@@ -58,10 +58,14 @@ template class spdlog::sinks::ansicolor_sink<spdlog::details::console_stderr, sp
#endif #endif
#include "spdlog/sinks/stdout_color_sinks-inl.h" #include "spdlog/sinks/stdout_color_sinks-inl.h"
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::synchronous_factory>(const std::string &logger_name, color_mode mode); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::synchronous_factory>(
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::synchronous_factory>(const std::string &logger_name, color_mode mode); const std::string &logger_name, color_mode mode);
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_mt<spdlog::synchronous_factory>(const std::string &logger_name, color_mode mode); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::synchronous_factory>(
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_st<spdlog::synchronous_factory>(const std::string &logger_name, color_mode mode); const std::string &logger_name, color_mode mode);
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_mt<spdlog::synchronous_factory>(
const std::string &logger_name, color_mode mode);
template std::shared_ptr<spdlog::logger> spdlog::stderr_color_st<spdlog::synchronous_factory>(
const std::string &logger_name, color_mode mode);
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::async_factory>(const std::string &logger_name, color_mode mode); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_mt<spdlog::async_factory>(const std::string &logger_name, color_mode mode);
template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::async_factory>(const std::string &logger_name, color_mode mode); template std::shared_ptr<spdlog::logger> spdlog::stdout_color_st<spdlog::async_factory>(const std::string &logger_name, color_mode mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment