# HG changeset patch # User Chris Cannam # Date 1544437695 0 # Node ID af295de6a59b75a3e28887adfe18ad1e5512e2cd # Parent 8ec848c6a4b437ef2a0f97f82003e5ce02e012a7 Ensure debug log is always created, in %AppData% diff -r 8ec848c6a4b4 -r af295de6a59b src/debug.cpp --- a/src/debug.cpp Sun Dec 09 16:46:44 2018 +0000 +++ b/src/debug.cpp Mon Dec 10 10:28:15 2018 +0000 @@ -42,7 +42,7 @@ sprintf(prefix, "[%lu]", (unsigned long)QCoreApplication::applicationPid()); QString logFileName = QDir::homePath() + "/.easyhg.log"; // the fallback QString logDir = QStandardPaths::writableLocation - (QStandardPaths::DataLocation); + (QStandardPaths::AppDataLocation); if (logDir != "" && (QDir(logDir).exists() || QDir().mkpath(logDir))) { diff -r 8ec848c6a4b4 -r af295de6a59b src/debug.h --- a/src/debug.h Sun Dec 09 16:46:44 2018 +0000 +++ b/src/debug.h Mon Dec 10 10:28:15 2018 +0000 @@ -15,8 +15,8 @@ COPYING included with this distribution for more information. */ -#ifndef _DEBUG_H_ -#define _DEBUG_H_ +#ifndef EASYHG_DEBUG_H +#define EASYHG_DEBUG_H #include #include @@ -30,8 +30,6 @@ std::ostream &operator<<(std::ostream &, const QString &); std::ostream &operator<<(std::ostream &, const QUrl &); -#ifndef NDEBUG - extern QDebug &getEasyHgDebug(); #define DEBUG getEasyHgDebug() @@ -45,23 +43,5 @@ return d; } -#else - -class NoDebug -{ -public: - inline NoDebug() {} - inline ~NoDebug(){} - - template - inline NoDebug &operator<<(const T &) { return *this; } - - inline NoDebug &operator<<(QTextStreamFunction) { return *this; } -}; - -#define DEBUG NoDebug() - -#endif /* !NDEBUG */ - #endif /* !_DEBUG_H_ */