Mercurial > hg > easyhg
comparison debug.cpp @ 167:94be1e218655
* Overwrite log file for each run (saving space at expense of long record)
author | Chris Cannam |
---|---|
date | Wed, 08 Dec 2010 16:57:18 +0000 |
parents | 68aebc316898 |
children | b6dd1ee0e486 |
comparison
equal
deleted
inserted
replaced
166:0dfd6567ec0c | 167:94be1e218655 |
---|---|
38 mutex.lock(); | 38 mutex.lock(); |
39 if (!debug) { | 39 if (!debug) { |
40 prefix = new char[20]; | 40 prefix = new char[20]; |
41 sprintf(prefix, "[%lu]", (unsigned long)QCoreApplication::applicationPid()); | 41 sprintf(prefix, "[%lu]", (unsigned long)QCoreApplication::applicationPid()); |
42 logFile = new QFile(QDir::homePath() + "/.easyhg.log"); | 42 logFile = new QFile(QDir::homePath() + "/.easyhg.log"); |
43 if (logFile->open(QIODevice::WriteOnly | QIODevice::Append)) { | 43 if (logFile->open(QIODevice::WriteOnly)) { |
44 QDebug(QtDebugMsg) << (const char *)prefix | 44 QDebug(QtDebugMsg) << (const char *)prefix |
45 << "Opened debug log file " | 45 << "Opened debug log file " |
46 << logFile->fileName(); | 46 << logFile->fileName(); |
47 debug = new QDebug(logFile); | 47 debug = new QDebug(logFile); |
48 } else { | 48 } else { |