diff --git a/include/asset.hpp b/include/asset.hpp index e65cb512..4ee7722f 100644 --- a/include/asset.hpp +++ b/include/asset.hpp @@ -26,6 +26,7 @@ std::string plugin(plugin::Plugin *plugin, std::string filename); extern std::string systemDir; extern std::string userDir; +extern std::string logPath; extern std::string pluginsPath; extern std::string settingsPath; extern std::string autosavePath; diff --git a/src/asset.cpp b/src/asset.cpp index e833d781..9de69a98 100644 --- a/src/asset.cpp +++ b/src/asset.cpp @@ -112,6 +112,7 @@ void init() { templatePath = userDir + "/template.vcv"; } else { + logPath = userDir + "/log.txt"; pluginsPath = userDir + "/plugins-v" + app::ABI_VERSION; settingsPath = userDir + "/settings-v" + app::ABI_VERSION + ".json"; autosavePath = userDir + "/autosave-v" + app::ABI_VERSION + ".vcv"; @@ -139,6 +140,7 @@ std::string plugin(plugin::Plugin *plugin, std::string filename) { std::string systemDir; std::string userDir; +std::string logPath; std::string pluginsPath; std::string settingsPath; std::string autosavePath; diff --git a/src/logger.cpp b/src/logger.cpp index b923bbb5..85af9252 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -21,10 +21,9 @@ void init() { return; } - std::string logFilename = asset::user("log.txt"); - outputFile = fopen(logFilename.c_str(), "w"); + outputFile = fopen(asset::logPath.c_str(), "w"); if (!outputFile) { - fprintf(stderr, "Could not open log at %s\n", logFilename.c_str()); + fprintf(stderr, "Could not open log at %s\n", asset::logPath.c_str()); } } diff --git a/src/main.cpp b/src/main.cpp index aa50229b..413105a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ static void fatalSignalHandler(int sig) { // This might fail because we might not be in the main thread. // But oh well, we're crashing anyway. - std::string text = app::APP_NAME + " has crashed. See log.txt for details."; + std::string text = app::APP_NAME + " has crashed. See " + asset::logPath + " for details."; osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, text.c_str()); abort();