@@ -26,6 +26,7 @@ std::string plugin(plugin::Plugin *plugin, std::string filename); | |||||
extern std::string systemDir; | extern std::string systemDir; | ||||
extern std::string userDir; | extern std::string userDir; | ||||
extern std::string logPath; | |||||
extern std::string pluginsPath; | extern std::string pluginsPath; | ||||
extern std::string settingsPath; | extern std::string settingsPath; | ||||
extern std::string autosavePath; | extern std::string autosavePath; | ||||
@@ -112,6 +112,7 @@ void init() { | |||||
templatePath = userDir + "/template.vcv"; | templatePath = userDir + "/template.vcv"; | ||||
} | } | ||||
else { | else { | ||||
logPath = userDir + "/log.txt"; | |||||
pluginsPath = userDir + "/plugins-v" + app::ABI_VERSION; | pluginsPath = userDir + "/plugins-v" + app::ABI_VERSION; | ||||
settingsPath = userDir + "/settings-v" + app::ABI_VERSION + ".json"; | settingsPath = userDir + "/settings-v" + app::ABI_VERSION + ".json"; | ||||
autosavePath = userDir + "/autosave-v" + app::ABI_VERSION + ".vcv"; | 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 systemDir; | ||||
std::string userDir; | std::string userDir; | ||||
std::string logPath; | |||||
std::string pluginsPath; | std::string pluginsPath; | ||||
std::string settingsPath; | std::string settingsPath; | ||||
std::string autosavePath; | std::string autosavePath; | ||||
@@ -21,10 +21,9 @@ void init() { | |||||
return; | return; | ||||
} | } | ||||
std::string logFilename = asset::user("log.txt"); | |||||
outputFile = fopen(logFilename.c_str(), "w"); | |||||
outputFile = fopen(asset::logPath.c_str(), "w"); | |||||
if (!outputFile) { | 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()); | |||||
} | } | ||||
} | } | ||||
@@ -39,7 +39,7 @@ static void fatalSignalHandler(int sig) { | |||||
// This might fail because we might not be in the main thread. | // This might fail because we might not be in the main thread. | ||||
// But oh well, we're crashing anyway. | // 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()); | osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, text.c_str()); | ||||
abort(); | abort(); | ||||