Commit 28da625a authored by gabime's avatar gabime

removed the confusing stop() function

parent c54c51b5
...@@ -60,7 +60,6 @@ protected: ...@@ -60,7 +60,6 @@ protected:
void _log_msg(details::log_msg& msg) override; void _log_msg(details::log_msg& msg) override;
void _set_formatter(spdlog::formatter_ptr msg_formatter) override; void _set_formatter(spdlog::formatter_ptr msg_formatter) override;
void _set_pattern(const std::string& pattern) override; void _set_pattern(const std::string& pattern) override;
void _stop() override;
private: private:
std::unique_ptr<details::async_log_helper> _async_log_helper; std::unique_ptr<details::async_log_helper> _async_log_helper;
......
...@@ -60,12 +60,6 @@ inline void spdlog::async_logger::_set_pattern(const std::string& pattern) ...@@ -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) inline void spdlog::async_logger::_log_msg(details::log_msg& msg)
{ {
_async_log_helper->log(msg); _async_log_helper->log(msg);
......
...@@ -229,11 +229,6 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons ...@@ -229,11 +229,6 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons
return msg_level >= _level.load(); 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 // 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) ...@@ -253,12 +248,4 @@ inline void spdlog::logger::_set_formatter(formatter_ptr msg_formatter)
_formatter = msg_formatter; _formatter = msg_formatter;
} }
inline void spdlog::logger::_stop()
{
set_level(level::off);
}
...@@ -127,14 +127,6 @@ public: ...@@ -127,14 +127,6 @@ public:
_async_mode = false; _async_mode = false;
} }
void stop_all()
{
std::lock_guard<std::mutex> lock(_mutex);
_level = level::off;
for (auto& l : _loggers)
l.second->stop();
}
static registry& instance() static registry& instance()
{ {
......
...@@ -142,7 +142,4 @@ inline void spdlog::set_sync_mode() ...@@ -142,7 +142,4 @@ inline void spdlog::set_sync_mode()
details::registry::instance().set_sync_mode(); details::registry::instance().set_sync_mode();
} }
inline void spdlog::stop()
{
return details::registry::instance().stop_all();
}
...@@ -62,10 +62,6 @@ public: ...@@ -62,10 +62,6 @@ public:
const std::string& name() const; const std::string& name() const;
bool should_log(level::level_enum) const; bool should_log(level::level_enum) const;
//Stop logging
void stop();
template <typename... Args> template <typename... Args>
details::line_logger trace(const char* fmt, const Args&... args); details::line_logger trace(const char* fmt, const Args&... args);
...@@ -118,7 +114,6 @@ protected: ...@@ -118,7 +114,6 @@ protected:
virtual void _log_msg(details::log_msg&); virtual void _log_msg(details::log_msg&);
virtual void _set_pattern(const std::string&); virtual void _set_pattern(const std::string&);
virtual void _set_formatter(formatter_ptr); virtual void _set_formatter(formatter_ptr);
virtual void _stop();
details::line_logger _log_if_enabled(level::level_enum lvl); details::line_logger _log_if_enabled(level::level_enum lvl);
template <typename... Args> template <typename... Args>
details::line_logger _log_if_enabled(level::level_enum lvl, const char* fmt, const Args&... args); details::line_logger _log_if_enabled(level::level_enum lvl, const char* fmt, const Args&... args);
......
...@@ -113,11 +113,6 @@ std::shared_ptr<logger> create(const std::string& logger_name, const It& sinks_b ...@@ -113,11 +113,6 @@ std::shared_ptr<logger> create(const std::string& logger_name, const It& sinks_b
template <typename Sink, typename... Args> template <typename Sink, typename... Args>
std::shared_ptr<spdlog::logger> create(const std::string& logger_name, const Args&...); std::shared_ptr<spdlog::logger> 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. // 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. // Note: using these mactors overrides the runtime log threshold of the logger.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment