mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
添加异步日志线程
This commit is contained in:
parent
bf499916d8
commit
ee4659a185
@ -48,6 +48,8 @@ API_EXPORT void API_CALL mk_env_init(const config *cfg) {
|
|||||||
assert(cfg != nullptr);
|
assert(cfg != nullptr);
|
||||||
static onceToken token([&]() {
|
static onceToken token([&]() {
|
||||||
Logger::Instance().add(std::make_shared<ConsoleChannel>("console", (LogLevel) cfg->log_level));
|
Logger::Instance().add(std::make_shared<ConsoleChannel>("console", (LogLevel) cfg->log_level));
|
||||||
|
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
|
||||||
|
|
||||||
EventPollerPool::setPoolSize(cfg->thread_num);
|
EventPollerPool::setPoolSize(cfg->thread_num);
|
||||||
WorkThreadPool::setPoolSize(cfg->thread_num);
|
WorkThreadPool::setPoolSize(cfg->thread_num);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user