mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed (#3009)
* Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed * Code review fix - periodic_worker thread getter should return a reference and not a pointer
This commit is contained in:
parent
47b7e7c736
commit
fe79bfcc51
@ -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
|
||||
|
@ -68,6 +68,8 @@ public:
|
||||
periodic_flusher_ = details::make_unique<periodic_worker>(clbk, interval);
|
||||
}
|
||||
|
||||
std::unique_ptr<periodic_worker> &get_flusher() { std::lock_guard<std::mutex> lock(flusher_mutex_); return periodic_flusher_; }
|
||||
|
||||
void set_error_handler(err_handler handler);
|
||||
|
||||
void apply_all(const std::function<void(const std::shared_ptr<logger>)> &fun);
|
||||
|
Loading…
Reference in New Issue
Block a user