修复c api日志路径设置可能出错的问题

This commit is contained in:
ziyue 2022-02-24 11:30:19 +08:00
parent 63f22ee6f2
commit 5c6dcd041f

View File

@ -87,7 +87,7 @@ API_EXPORT void API_CALL mk_env_init1(int thread_num,
if (log_mask & LOG_FILE) {
//日志文件
auto channel = std::make_shared<FileChannel>("FileChannel",
log_file_path ? File::absolutePath(log_file_path, "") :
log_file_path ? File::absolutePath("", log_file_path) :
exeDir() + "log/", (LogLevel) log_level);
channel->setMaxDay(log_file_days ? log_file_days : 1);
Logger::Instance().add(channel);