mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
Allow overriding need_localtime for custom formatter
This commit is contained in:
@@ -1081,6 +1081,11 @@ SPDLOG_INLINE void pattern_formatter::set_pattern(std::string pattern)
|
||||
compile_pattern_(pattern_);
|
||||
}
|
||||
|
||||
SPDLOG_INLINE void pattern_formatter::need_localtime(bool need)
|
||||
{
|
||||
need_localtime_ = need;
|
||||
}
|
||||
|
||||
SPDLOG_INLINE std::tm pattern_formatter::get_time_(const details::log_msg &msg)
|
||||
{
|
||||
if (pattern_time_type_ == pattern_time_type::local)
|
||||
|
@@ -98,6 +98,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
void set_pattern(std::string pattern);
|
||||
void need_localtime(bool need = true);
|
||||
|
||||
private:
|
||||
std::string pattern_;
|
||||
|
Reference in New Issue
Block a user