Browse Source

Add log path to fatal signal handler dialog message.

tags/v1.1.2
Andrew Belt 5 years ago
parent
commit
6163efdf13
4 changed files with 6 additions and 4 deletions
  1. +1
    -0
      include/asset.hpp
  2. +2
    -0
      src/asset.cpp
  3. +2
    -3
      src/logger.cpp
  4. +1
    -1
      src/main.cpp

+ 1
- 0
include/asset.hpp View File

@@ -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;


+ 2
- 0
src/asset.cpp View File

@@ -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;


+ 2
- 3
src/logger.cpp View File

@@ -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());
}
}



+ 1
- 1
src/main.cpp View File

@@ -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();


Loading…
Cancel
Save