From 64850dcb0c4d7af8ce2b2c9f400cc604ab796c1a Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 9 May 2015 16:03:43 +0300 Subject: [PATCH] small style fixes --- include/spdlog/details/logger_impl.h | 7 ++++--- include/spdlog/sinks/file_sinks.h | 6 ++++-- include/spdlog/sinks/ostream_sink.h | 5 +++-- include/spdlog/sinks/syslog_sink.h | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index fa4731ae..d658ac03 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -50,7 +50,9 @@ inline spdlog::logger::logger(const std::string& logger_name, sinks_init_list si // ctor with single sink inline spdlog::logger::logger(const std::string& logger_name, spdlog::sink_ptr single_sink) : - logger(logger_name, { single_sink }) {} + logger(logger_name, { + single_sink +}) {} inline spdlog::logger::~logger() = default; @@ -313,7 +315,6 @@ inline void spdlog::logger::_set_formatter(formatter_ptr msg_formatter) } inline void spdlog::logger::flush() { - for (auto& sink : _sinks) { + for (auto& sink : _sinks) sink->flush(); - } } \ No newline at end of file diff --git a/include/spdlog/sinks/file_sinks.h b/include/spdlog/sinks/file_sinks.h index 0e705337..1c2f2998 100644 --- a/include/spdlog/sinks/file_sinks.h +++ b/include/spdlog/sinks/file_sinks.h @@ -80,7 +80,8 @@ public: _file_helper.open(calc_filename(_base_filename, 0, _extension)); } - virtual void flush() override { + void flush() override + { _file_helper.flush(); } @@ -171,7 +172,8 @@ public: _file_helper.open(calc_filename(_base_filename, _extension)); } - virtual void flush() override { + void flush() override + { _file_helper.flush(); } diff --git a/include/spdlog/sinks/ostream_sink.h b/include/spdlog/sinks/ostream_sink.h index 7b6b9db3..f2fe3b23 100644 --- a/include/spdlog/sinks/ostream_sink.h +++ b/include/spdlog/sinks/ostream_sink.h @@ -45,14 +45,15 @@ public: virtual ~ostream_sink() = default; protected: - virtual void _sink_it(const details::log_msg& msg) override + void _sink_it(const details::log_msg& msg) override { _ostream.write(msg.formatted.data(), msg.formatted.size()); if (_force_flush) _ostream.flush(); } - virtual void flush() override { + void flush() override + { _ostream.flush(); } diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 15a96fee..37b65136 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -78,7 +78,8 @@ public: ::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str()); } - virtual void flush() override { + void flush() override + { }