mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
More improvements to the async logger
This commit is contained in:
@@ -61,7 +61,7 @@ public:
|
||||
return found->second;
|
||||
std::shared_ptr<logger> new_logger;
|
||||
if (_async_mode)
|
||||
new_logger = std::make_shared<async_logger>(logger_name, sinks_begin, sinks_end, _async_q_size, _async_shutdown_duration);
|
||||
new_logger = std::make_shared<async_logger>(logger_name, sinks_begin, sinks_end, _async_q_size);
|
||||
else
|
||||
new_logger = std::make_shared<logger>(logger_name, sinks_begin, sinks_end);
|
||||
|
||||
@@ -114,12 +114,11 @@ public:
|
||||
l.second->set_level(log_level);
|
||||
}
|
||||
|
||||
void set_async_mode(size_t q_size, const log_clock::duration& shutdown_duration)
|
||||
void set_async_mode(size_t q_size)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
_async_mode = true;
|
||||
_async_q_size = q_size;
|
||||
_async_shutdown_duration = shutdown_duration;
|
||||
}
|
||||
|
||||
void set_sync_mode()
|
||||
@@ -153,7 +152,6 @@ private:
|
||||
level::level_enum _level = level::INFO;
|
||||
bool _async_mode = false;
|
||||
size_t _async_q_size = 0;
|
||||
log_clock::duration _async_shutdown_duration;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user