[Logs]Don't create a thread for each logger (#22755)

This commit is contained in:
Jaime Bernardo 2022-12-13 17:16:31 +00:00 committed by GitHub
parent f987a48b3a
commit f465daf585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,8 +91,8 @@ void Logger::init(std::string loggerName, std::wstring logFilePath, std::wstring
logger->set_level(logLevel);
logger->set_pattern("[%Y-%m-%d %H:%M:%S.%f] [p-%P] [t-%t] [%l] %v");
logger->flush_on(logLevel); // Auto flush on every log message.
spdlog::register_logger(logger);
spdlog::flush_every(std::chrono::seconds(3));
logger->info("{} logger is initialized", loggerName);
}