Place logs in /tmp on macOS
This commit is contained in:
parent
4e60ccb2ff
commit
8ae01fae3f
1 changed files with 6 additions and 0 deletions
|
|
@ -132,7 +132,13 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
#ifdef USE_CUSTOM_LOGGER
|
||||
#ifdef LOG_TO_FILE
|
||||
#ifdef Q_OS_DARWIN
|
||||
// On macOS, $TMPDIR is some random folder under /var/folders/ that nobody can
|
||||
// easily find, so use the system's global tmp directory instead.
|
||||
QDir tempDir("/tmp");
|
||||
#else
|
||||
QDir tempDir(QDir::tempPath());
|
||||
#endif
|
||||
s_LoggerFile = new QFile(tempDir.filePath(QString("Moonlight-%1.log").arg(QDateTime::currentSecsSinceEpoch())));
|
||||
if (s_LoggerFile->open(QIODevice::WriteOnly)) {
|
||||
qInfo() << "Redirecting log output to " << s_LoggerFile->fileName();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue