mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Write crash log to temporary directory
To make sure current user has rights to do so.
This commit is contained in:
parent
3a9a60a453
commit
007ad4e4d1
@ -1,6 +1,7 @@
|
|||||||
#ifndef CRASHCATCHER_H
|
#ifndef CRASHCATCHER_H
|
||||||
#define CRASHCATCHER_H
|
#define CRASHCATCHER_H
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \
|
#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \
|
||||||
|
@ -329,12 +329,13 @@ int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, c
|
|||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
const std::string crashLogName = Misc::StringUtils::lowerCase(appName) + "-crash.dmp";
|
const std::string crashLogName = Misc::StringUtils::lowerCase(appName) + "-crash.dmp";
|
||||||
Crash::CrashCatcher crashy(argc, argv, Files::pathToUnicodeString(cfgMgr.getLogPath() / crashLogName));
|
Crash::CrashCatcher crashy(
|
||||||
|
argc, argv, Files::pathToUnicodeString(std::filesystem::temp_directory_path() / crashLogName));
|
||||||
#else
|
#else
|
||||||
const std::string crashLogName = Misc::StringUtils::lowerCase(appName) + "-crash.log";
|
const std::string crashLogName = Misc::StringUtils::lowerCase(appName) + "-crash.log";
|
||||||
// install the crash handler as soon as possible. note that the log path
|
// install the crash handler as soon as possible.
|
||||||
// does not depend on config being read.
|
crashCatcherInstall(
|
||||||
crashCatcherInstall(argc, argv, Files::pathToUnicodeString(cfgMgr.getLogPath() / crashLogName));
|
argc, argv, Files::pathToUnicodeString(std::filesystem::temp_directory_path() / crashLogName));
|
||||||
#endif
|
#endif
|
||||||
ret = innerApplication(argc, argv);
|
ret = innerApplication(argc, argv);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user