Commit 0c7beb2e authored by gabime's avatar gabime

fixed issue #173 - timezone as output by %z option has a double negative sign

parent e91e1b80
...@@ -317,8 +317,10 @@ public: ...@@ -317,8 +317,10 @@ public:
int h = total_minutes / 60; int h = total_minutes / 60;
int m = total_minutes % 60; int m = total_minutes % 60;
char sign = h >= 0 ? '+' : '-'; if (h >= 0) //minus sign will be printed anyway if negative
msg.formatted << sign; {
msg.formatted << '+';
}
pad_n_join(msg.formatted, h, m, ':'); pad_n_join(msg.formatted, h, m, ':');
} }
private: private:
...@@ -481,7 +483,7 @@ inline void spdlog::pattern_formatter::handle_flag(char flag) ...@@ -481,7 +483,7 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
{ {
switch (flag) switch (flag)
{ {
// logger name // logger name
case 'n': case 'n':
_formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::name_formatter())); _formatters.push_back(std::unique_ptr<details::flag_formatter>(new details::name_formatter()));
break; break;
......
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