From 02cb17c831d17702caddaaa7c0d8b60336024f6e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 21 Nov 2023 10:50:43 +0100 Subject: [PATCH] Store sentry logs in correct place By default it stores them in the cwd, which won't work for actual instals. It now places them in the root Cura folder CURA-11364 --- src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 84920c5006..c185c6d163 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,19 @@ int main(int argc, char** argv) sentry_options_set_dsn(options, "https://734f9ec9024f73e53701d59c3ffddfe3@o323038.ingest.sentry.io/4506257745510401"); // This is also the default-path. For further information and recommendations: // https://docs.sentry.io/platforms/native/configuration/options/#database-path - sentry_options_set_database_path(options, ".sentry-native"); + std::string config_path = ""; + +#if defined(__linux__) + config_path += getenv("HOME"); + config_path += "/.local/share/cura/"; +#elif defined(__APPLE__) && defined(__MACH__) + config_path += getenv("HOME"); + config_path += "/Library/Application Support/cura/"; +#elif defined(_WIN64) + config_path = "%APPDATA%\\cura\\"; +#endif + config_path += ".sentry-native"; + sentry_options_set_database_path(options, config_path.c_str()); std::string version = "curaengine@"; version += std::string(CURA_ENGINE_VERSION); sentry_options_set_release(options, version.c_str());