mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 02:19:35 +08:00
Expend support for any std::chrono::duration in spdlog::flush_every
This allows things like: spdlog::flush_every(std::chrono::minutes(10)); spdlog::flush_every(std::chrono::milliseconds(100));
This commit is contained in:
@@ -81,7 +81,11 @@ SPDLOG_API void flush_on(level::level_enum log_level);
|
||||
|
||||
// Start/Restart a periodic flusher thread
|
||||
// Warning: Use only if all your loggers are thread safe!
|
||||
SPDLOG_API void flush_every(std::chrono::seconds interval);
|
||||
template<typename Rep, typename Period>
|
||||
inline void flush_every(std::chrono::duration<Rep, Period> interval)
|
||||
{
|
||||
details::registry::instance().flush_every(interval);
|
||||
}
|
||||
|
||||
// Set global error handler
|
||||
SPDLOG_API void set_error_handler(void (*handler)(const std::string &msg));
|
||||
|
Reference in New Issue
Block a user