Commit 33329c80 authored by gabime's avatar gabime

code formatting

parent fe732554
......@@ -37,7 +37,6 @@ inline spdlog::logger::logger(std::string logger_name, spdlog::sink_ptr single_s
inline spdlog::logger::~logger() = default;
inline void spdlog::logger::set_formatter(std::unique_ptr<spdlog::formatter> f)
{
for (auto &sink : sinks_)
......
......@@ -75,7 +75,7 @@ static int to12h(const tm &t)
}
// Abbreviated weekday name
static const char* days[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
static const char *days[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
class a_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
......@@ -85,7 +85,7 @@ class a_formatter : public flag_formatter
};
// Full weekday name
static const char* full_days[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
static const char *full_days[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
class A_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
......@@ -95,7 +95,7 @@ class A_formatter : public flag_formatter
};
// Abbreviated month
static const char* months[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
static const char *months[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
class b_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
......@@ -105,7 +105,7 @@ class b_formatter : public flag_formatter
};
// Full month name
static const char* full_months[]{
static const char *full_months[]{
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
class B_formatter : public flag_formatter
{
......
......@@ -81,7 +81,6 @@ public:
return tp_;
}
// Set global formatter. Each sink in each logger will get a clone of this object
void set_formatter(std::unique_ptr<formatter> formatter)
{
......@@ -169,7 +168,10 @@ public:
}
private:
registry_t<Mutex>() : formatter_(new pattern_formatter("%+")){}
registry_t<Mutex>()
: formatter_(new pattern_formatter("%+"))
{
}
~registry_t<Mutex>()
{
......@@ -196,7 +198,7 @@ private:
Mutex loggers_mutex_;
std::recursive_mutex tp_mutex_;
std::unordered_map<std::string, std::shared_ptr<logger>> loggers_;
//std::unique_ptr<formatter> formatter_{ new pattern_formatter("%+") };
// std::unique_ptr<formatter> formatter_{ new pattern_formatter("%+") };
std::unique_ptr<formatter> formatter_;
level::level_enum level_ = level::info;
level::level_enum flush_level_ = level::off;
......
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