diff --git a/include/spdlog/details/periodic_worker.h b/include/spdlog/details/periodic_worker.h index d05245cb..d647b66e 100644 --- a/include/spdlog/details/periodic_worker.h +++ b/include/spdlog/details/periodic_worker.h @@ -38,6 +38,7 @@ public: } }); } + std::thread &get_thread() { return worker_thread_; } periodic_worker(const periodic_worker &) = delete; periodic_worker &operator=(const periodic_worker &) = delete; // stop the worker thread and join it diff --git a/include/spdlog/details/registry.h b/include/spdlog/details/registry.h index 56a6886e..1dff8cdb 100644 --- a/include/spdlog/details/registry.h +++ b/include/spdlog/details/registry.h @@ -68,6 +68,8 @@ public: periodic_flusher_ = details::make_unique(clbk, interval); } + std::unique_ptr &get_flusher() { std::lock_guard lock(flusher_mutex_); return periodic_flusher_; } + void set_error_handler(err_handler handler); void apply_all(const std::function)> &fun);