diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index 518e61cf..c894399c 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -60,7 +60,6 @@ protected: void _log_msg(details::log_msg& msg) override; void _set_formatter(spdlog::formatter_ptr msg_formatter) override; void _set_pattern(const std::string& pattern) override; - void _stop() override; private: std::unique_ptr _async_log_helper; diff --git a/include/spdlog/details/async_logger_impl.h b/include/spdlog/details/async_logger_impl.h index cb9b1bc9..0129e2fd 100644 --- a/include/spdlog/details/async_logger_impl.h +++ b/include/spdlog/details/async_logger_impl.h @@ -60,12 +60,6 @@ inline void spdlog::async_logger::_set_pattern(const std::string& pattern) } - -inline void spdlog::async_logger::_stop() -{ - set_level(level::off); -} - inline void spdlog::async_logger::_log_msg(details::log_msg& msg) { _async_log_helper->log(msg); diff --git a/include/spdlog/details/logger_impl.h b/include/spdlog/details/logger_impl.h index 3b680063..12f8dd36 100644 --- a/include/spdlog/details/logger_impl.h +++ b/include/spdlog/details/logger_impl.h @@ -229,11 +229,6 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons return msg_level >= _level.load(); } -inline void spdlog::logger::stop() -{ - _stop(); -} - // // protected virtual called at end of each user log call (if enabled) by the line_logger // @@ -253,12 +248,4 @@ inline void spdlog::logger::_set_formatter(formatter_ptr msg_formatter) _formatter = msg_formatter; } -inline void spdlog::logger::_stop() -{ - set_level(level::off); -} - - - - diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index 2fee86d7..96819cfc 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -127,14 +127,6 @@ public: _async_mode = false; } - void stop_all() - { - std::lock_guard lock(_mutex); - _level = level::off; - for (auto& l : _loggers) - l.second->stop(); - } - static registry& instance() { diff --git a/include/spdlog/details/spdlog_impl.h b/include/spdlog/details/spdlog_impl.h index 6b72f24b..2303ee0c 100644 --- a/include/spdlog/details/spdlog_impl.h +++ b/include/spdlog/details/spdlog_impl.h @@ -142,7 +142,4 @@ inline void spdlog::set_sync_mode() details::registry::instance().set_sync_mode(); } -inline void spdlog::stop() -{ - return details::registry::instance().stop_all(); -} + diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 6137e81f..4fa39a54 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -62,10 +62,6 @@ public: const std::string& name() const; bool should_log(level::level_enum) const; - //Stop logging - void stop(); - - template details::line_logger trace(const char* fmt, const Args&... args); @@ -118,7 +114,6 @@ protected: virtual void _log_msg(details::log_msg&); virtual void _set_pattern(const std::string&); virtual void _set_formatter(formatter_ptr); - virtual void _stop(); details::line_logger _log_if_enabled(level::level_enum lvl); template details::line_logger _log_if_enabled(level::level_enum lvl, const char* fmt, const Args&... args); diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 5b03b939..ec8e4717 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -113,11 +113,6 @@ std::shared_ptr create(const std::string& logger_name, const It& sinks_b template std::shared_ptr create(const std::string& logger_name, const Args&...); - -// Stop logging by setting all the loggers to log level OFF -void stop(); - - // // Trace & debug macros to be switched on/off at compile time for zero cost debug statements. // Note: using these mactors overrides the runtime log threshold of the logger.