diff --git a/src/main.cpp b/src/main.cpp index 4c7cd1d..7541d23 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,11 +21,12 @@ int main() signal(SIGPIPE, SIG_IGN); // 初始化日志文件 - Logger::set_log_to_file("app.log"); + Logger::set_log_to_file(get_executable_dir_file_path("app.log")); try { - g_app_config = AppConfig::load_from_file("config.json"); + // 从可执行文件所在目录读取配置文件 + g_app_config = AppConfig::load_from_file(get_executable_dir_file_path("config.json")); } catch (const std::exception &e) {