mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
static lib wip
This commit is contained in:
@@ -38,9 +38,6 @@ inline spdlog::async_logger::async_logger(
|
||||
// send the log message to the thread pool
|
||||
inline void spdlog::async_logger::sink_it_(details::log_msg &msg)
|
||||
{
|
||||
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
|
||||
incr_msg_counter_(msg);
|
||||
#endif
|
||||
if (auto pool_ptr = thread_pool_.lock())
|
||||
{
|
||||
pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
|
||||
@@ -119,6 +116,6 @@ inline std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::string n
|
||||
|
||||
cloned->set_level(this->level());
|
||||
cloned->flush_on(this->flush_level());
|
||||
cloned->set_error_handler(this->error_handler());
|
||||
cloned->set_error_handler(this->custom_err_handler_);
|
||||
return std::move(cloned);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -154,7 +154,7 @@ public:
|
||||
periodic_flusher_ = details::make_unique<periodic_worker>(clbk, interval);
|
||||
}
|
||||
|
||||
void set_error_handler(log_err_handler handler)
|
||||
void set_error_handler(void (*handler)(const std::string &msg))
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
||||
for (auto &l : loggers_)
|
||||
@@ -275,7 +275,7 @@ private:
|
||||
std::unique_ptr<formatter> formatter_;
|
||||
level::level_enum level_ = spdlog::logger::default_level();
|
||||
level::level_enum flush_level_ = level::off;
|
||||
log_err_handler err_handler_;
|
||||
void (*err_handler_)(const std::string &msg);
|
||||
std::shared_ptr<thread_pool> tp_;
|
||||
std::unique_ptr<periodic_worker> periodic_flusher_;
|
||||
std::shared_ptr<logger> default_logger_;
|
||||
|
Reference in New Issue
Block a user