More improvements to the async logger

This commit is contained in:
gabi
2014-12-07 04:18:07 +02:00
parent 9feb5fbaf0
commit d37bded994
6 changed files with 114 additions and 131 deletions

View File

@@ -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;
};
}
}