diff --git a/example/example.cpp b/example/example.cpp index 18bbc168..d9dcbaad 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -20,8 +20,8 @@ int main(int argc, char* argv[]) const unsigned int howmany = argc <= 1 ? 1000:atoi(argv[1]); - logger cout_logger ("", sinks::stdout_sink()); - cout_logger.info("Hello ") << "man"; + logger cout_logger ("", sinks::stdout_sink()); + cout_logger.info("Hello ") << "man"; auto fsink = std::make_shared("log", "txt", 1024*1024*50 , 5, 0); diff --git a/include/c11log/details/line_logger.h b/include/c11log/details/line_logger.h index 3578a52c..01e5a019 100644 --- a/include/c11log/details/line_logger.h +++ b/include/c11log/details/line_logger.h @@ -25,7 +25,7 @@ public: { if(enabled) { - _log_msg.msg_time = log_clock::now(); + _log_msg.msg_time = log_clock::now(); callback_logger->_formatter->format_header(callback_logger->_logger_name, _log_msg.msg_level, _log_msg.msg_time, @@ -56,7 +56,7 @@ public: _callback_logger->_log_it(_log_msg); } } - + template line_logger& operator<<(const T& what) { diff --git a/include/c11log/logger.h b/include/c11log/logger.h index 847b9a47..c89f6b00 100644 --- a/include/c11log/logger.h +++ b/include/c11log/logger.h @@ -35,7 +35,7 @@ public: using sinks_init_list = std::initializer_list; logger(const std::string& name, sinks_init_list, formatter_ptr = nullptr); - logger(const std::string& name, sink_ptr, formatter_ptr = nullptr); + logger(const std::string& name, sink_ptr, formatter_ptr = nullptr); ~logger() = default; @@ -56,7 +56,7 @@ public: template details::line_logger info(const T&); template details::line_logger warn(const T&); template details::line_logger error(const T&); - template details::line_logger critical(const T&); + template details::line_logger critical(const T&); template details::line_logger fatal(const T&); @@ -89,13 +89,13 @@ inline c11log::logger::logger(const std::string& name, sinks_init_list sinks_lis { //Seems that vs2013 doesnt support std::atomic member initialization, so its done here _logger_level = level::INFO; - if(!_formatter) - _formatter = std::make_shared(); + if(!_formatter) + _formatter = std::make_shared(); } inline c11log::logger::logger(const std::string& name, sink_ptr sink, formatter_ptr f) : - logger(name, {sink}, f) {} + logger(name, {sink}, f) {} inline c11log::details::line_logger c11log::logger::log(c11log::level::level_enum msg_level) { @@ -108,8 +108,8 @@ inline c11log::details::line_logger c11log::logger::debug(const T& what) { bool really_log = should_log(level::DEBUG); details::line_logger l(this, level::DEBUG, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } @@ -118,8 +118,8 @@ inline c11log::details::line_logger c11log::logger::info(const T& what) { bool really_log = should_log(level::INFO); details::line_logger l(this, level::INFO, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } @@ -129,8 +129,8 @@ inline c11log::details::line_logger c11log::logger::warn(const T& what) { bool really_log = should_log(level::WARNING); details::line_logger l(this, level::WARNING, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } @@ -140,8 +140,8 @@ inline c11log::details::line_logger c11log::logger::error(const T& what) { bool really_log = should_log(level::ERROR); details::line_logger l(this, level::ERROR, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } @@ -151,18 +151,18 @@ inline c11log::details::line_logger c11log::logger::critical(const T& what) { bool really_log = should_log(level::CRITICAL); details::line_logger l(this, level::CRITICAL, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } template inline c11log::details::line_logger c11log::logger::fatal(const T& what) { - bool really_log = should_log(level::FATAL); + bool really_log = should_log(level::FATAL); details::line_logger l(this, level::FATAL, really_log); - if(really_log) - l << what; + if(really_log) + l << what; return l; } diff --git a/include/c11log/sinks/base_sink.h b/include/c11log/sinks/base_sink.h index 6f5e2319..5382d213 100644 --- a/include/c11log/sinks/base_sink.h +++ b/include/c11log/sinks/base_sink.h @@ -46,11 +46,11 @@ protected: class null_sink:public base_sink { public: - static std::shared_ptr& get() - { - static auto inst = std::make_shared(); - return inst; - } + static std::shared_ptr& get() + { + static auto inst = std::make_shared(); + return inst; + } protected: void _sink_it(const details::log_msg&) override {}