mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Fixed missing braces around initializer warnings about std::array initializations
This commit is contained in:
parent
90801267ee
commit
3b425affd3
@ -396,8 +396,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)
|
||||||
|
@ -152,7 +152,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"}};
|
||||||
|
|
||||||
template<typename ScopedPadder>
|
template<typename ScopedPadder>
|
||||||
class a_formatter : public flag_formatter
|
class a_formatter : public flag_formatter
|
||||||
@ -171,7 +171,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Full weekday name
|
// Full weekday name
|
||||||
static std::array<const char *, 7> full_days{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
|
static std::array<const char *, 7> full_days{{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}};
|
||||||
|
|
||||||
template<typename ScopedPadder>
|
template<typename ScopedPadder>
|
||||||
class A_formatter : public flag_formatter
|
class A_formatter : public flag_formatter
|
||||||
@ -190,7 +190,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"}};
|
||||||
|
|
||||||
template<typename ScopedPadder>
|
template<typename ScopedPadder>
|
||||||
class b_formatter : public flag_formatter
|
class b_formatter : public flag_formatter
|
||||||
@ -209,8 +209,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"}};
|
||||||
|
|
||||||
template<typename ScopedPadder>
|
template<typename ScopedPadder>
|
||||||
class B_formatter : public flag_formatter
|
class B_formatter : public flag_formatter
|
||||||
|
@ -22,13 +22,13 @@ class syslog_sink : public base_sink<Mutex>
|
|||||||
public:
|
public:
|
||||||
syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting)
|
syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting)
|
||||||
: enable_formatting_{enable_formatting}
|
: enable_formatting_{enable_formatting}
|
||||||
, syslog_levels_{/* spdlog::level::trace */ LOG_DEBUG,
|
, syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||||
/* spdlog::level::debug */ LOG_DEBUG,
|
/* spdlog::level::debug */ LOG_DEBUG,
|
||||||
/* spdlog::level::info */ LOG_INFO,
|
/* spdlog::level::info */ LOG_INFO,
|
||||||
/* spdlog::level::warn */ LOG_WARNING,
|
/* spdlog::level::warn */ LOG_WARNING,
|
||||||
/* spdlog::level::err */ LOG_ERR,
|
/* spdlog::level::err */ LOG_ERR,
|
||||||
/* spdlog::level::critical */ LOG_CRIT,
|
/* spdlog::level::critical */ LOG_CRIT,
|
||||||
/* spdlog::level::off */ LOG_INFO}
|
/* spdlog::level::off */ LOG_INFO}}
|
||||||
, ident_{std::move(ident)}
|
, ident_{std::move(ident)}
|
||||||
{
|
{
|
||||||
// set ident to be program name if empty
|
// set ident to be program name if empty
|
||||||
|
@ -23,13 +23,13 @@ class systemd_sink : public base_sink<Mutex>
|
|||||||
public:
|
public:
|
||||||
//
|
//
|
||||||
systemd_sink()
|
systemd_sink()
|
||||||
: syslog_levels_{/* spdlog::level::trace */ LOG_DEBUG,
|
: syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||||
/* spdlog::level::debug */ LOG_DEBUG,
|
/* spdlog::level::debug */ LOG_DEBUG,
|
||||||
/* spdlog::level::info */ LOG_INFO,
|
/* spdlog::level::info */ LOG_INFO,
|
||||||
/* spdlog::level::warn */ LOG_WARNING,
|
/* spdlog::level::warn */ LOG_WARNING,
|
||||||
/* spdlog::level::err */ LOG_ERR,
|
/* spdlog::level::err */ LOG_ERR,
|
||||||
/* spdlog::level::critical */ LOG_CRIT,
|
/* spdlog::level::critical */ LOG_CRIT,
|
||||||
/* spdlog::level::off */ LOG_INFO}
|
/* spdlog::level::off */ LOG_INFO}}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~systemd_sink() override {}
|
~systemd_sink() override {}
|
||||||
|
Loading…
Reference in New Issue
Block a user