mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-24 17:41:34 +08:00
minor code cleanup
This commit is contained in:
parent
45da6c9c33
commit
887326e715
@ -329,23 +329,19 @@ public:
|
||||
int total_minutes = os::utc_minutes_offset(tm_time);
|
||||
#endif
|
||||
bool is_negative = total_minutes < 0;
|
||||
char sign;
|
||||
if (is_negative)
|
||||
{
|
||||
total_minutes = -total_minutes;
|
||||
sign = '-';
|
||||
dest.push_back('-');
|
||||
}
|
||||
else
|
||||
{
|
||||
sign = '+';
|
||||
dest.push_back('+');
|
||||
}
|
||||
|
||||
int h = total_minutes / 60;
|
||||
int m = total_minutes % 60;
|
||||
dest.push_back(sign);
|
||||
fmt_helper::pad2(h, dest);
|
||||
fmt_helper::pad2(total_minutes / 60, dest); //hours
|
||||
dest.push_back(':');
|
||||
fmt_helper::pad2(m, dest);
|
||||
fmt_helper::pad2(total_minutes % 60, dest); //minutes
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -19,17 +19,7 @@ public:
|
||||
: formatter_(std::unique_ptr<spdlog::formatter>(new pattern_formatter("%+")))
|
||||
{
|
||||
}
|
||||
//
|
||||
// explicit sink(const std::string &formatter_pattern)
|
||||
// : formatter_(std::unique_ptr<spdlog::formatter>(new pattern_formatter(formatter_pattern)))
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// // sink with custom formatter
|
||||
// explicit sink(std::unique_ptr<spdlog::formatter> sink_formatter)
|
||||
// : formatter_(std::move(sink_formatter))
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
virtual ~sink() = default;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user