Skip to content

Commit

Permalink
chore: redirect crash log to cache path.
Browse files Browse the repository at this point in the history
as above.

Log: as above.
  • Loading branch information
itsXuSt authored and deepin-bot[bot] committed Dec 13, 2024
1 parent 8aa68ab commit 006c772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepin-system-monitor-main/stack_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <stdlib.h>
#include <unistd.h>

#include <QStandardPaths>

namespace util {

#define MAX_BACKTRACE_FRAMES 128
Expand Down Expand Up @@ -52,7 +54,9 @@ static inline void printStacktrace(int signum)
logstr[len] = 0;

// open log output stream
std::string logN {"/tmp/"};
auto cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
if (!cachePath.endsWith("/")) cachePath.append("/");
std::string logN {cachePath.toStdString()};
logN.append(logstr);
std::ofstream log(logN, std::ios::out);

Expand Down

0 comments on commit 006c772

Please sign in to comment.