We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bcd403 commit 6ca2b8aCopy full SHA for 6ca2b8a
deepin-system-monitor-main/stack_trace.h
@@ -17,6 +17,8 @@
17
#include <stdlib.h>
18
#include <unistd.h>
19
20
+#include <QStandardPaths>
21
+
22
namespace util {
23
24
#define MAX_BACKTRACE_FRAMES 128
@@ -52,7 +54,9 @@ static inline void printStacktrace(int signum)
52
54
logstr[len] = 0;
53
55
56
// open log output stream
- std::string logN {"/tmp/"};
57
+ auto cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
58
+ if (!cachePath.endsWith("/")) cachePath.append("/");
59
+ std::string logN {cachePath.toStdString()};
60
logN.append(logstr);
61
std::ofstream log(logN, std::ios::out);
62
0 commit comments