diff --git a/include/spdlog/details/file_helper.h b/include/spdlog/details/file_helper.h index 754f6885..7deff3ae 100644 --- a/include/spdlog/details/file_helper.h +++ b/include/spdlog/details/file_helper.h @@ -31,9 +31,7 @@ public: const int open_tries = 5; const int open_interval = 10; - explicit file_helper() : - _fd(nullptr) - {} + explicit file_helper() {} file_helper(const file_helper&) = delete; file_helper& operator=(const file_helper&) = delete; @@ -138,7 +136,7 @@ public: return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index)); } private: - FILE* _fd; + FILE* _fd{ nullptr }; filename_t _filename; }; } diff --git a/include/spdlog/details/pattern_formatter_impl.h b/include/spdlog/details/pattern_formatter_impl.h index 86c89370..5dc257d1 100644 --- a/include/spdlog/details/pattern_formatter_impl.h +++ b/include/spdlog/details/pattern_formatter_impl.h @@ -310,13 +310,12 @@ class T_formatter SPDLOG_FINAL:public flag_formatter }; // ISO 8601 offset from UTC in timezone (+-HH:MM) -class z_formatter SPDLOG_FINAL:public flag_formatter +class z_formatter SPDLOG_FINAL : public flag_formatter { public: const std::chrono::seconds cache_refresh = std::chrono::seconds(5); - z_formatter():_last_update(std::chrono::seconds(0)), _offset_minutes(0) - {} + z_formatter() {} z_formatter(const z_formatter&) = delete; z_formatter& operator=(const z_formatter&) = delete; @@ -347,8 +346,8 @@ public: pad_n_join(msg.formatted, h, m, ':'); } private: - log_clock::time_point _last_update; - int _offset_minutes; + log_clock::time_point _last_update{ std::chrono::seconds(0) }; + int _offset_minutes{ 0 }; std::mutex _mutex; int get_cached_offset(const log_msg& msg, const std::tm& tm_time) diff --git a/include/spdlog/sinks/sink.h b/include/spdlog/sinks/sink.h index 8fb045c6..770a2d30 100644 --- a/include/spdlog/sinks/sink.h +++ b/include/spdlog/sinks/sink.h @@ -14,11 +14,6 @@ namespace sinks class sink { public: - sink() - { - _level = level::trace; - } - virtual ~sink() = default; virtual void log(const details::log_msg& msg) = 0; virtual void flush() = 0; @@ -28,7 +23,7 @@ public: level::level_enum level() const; private: - level_t _level; + level_t _level{ level::trace }; }; inline bool sink::should_log(level::level_enum msg_level) const