comparison base/Debug.cpp @ 1058:c49d52386cde tonioni

Fix to opening debug file
author Chris Cannam
date Wed, 25 Mar 2015 10:54:51 +0000
parents e8e6c4e7437b
children c1e43c8d2527
comparison
equal deleted inserted replaced
1057:5c5d4863b428 1058:c49d52386cde
44 44
45 if (!prefix) { 45 if (!prefix) {
46 prefix = strdup(QString("[%1]") 46 prefix = strdup(QString("[%1]")
47 .arg(QCoreApplication::applicationPid()) 47 .arg(QCoreApplication::applicationPid())
48 .toLatin1().data()); 48 .toLatin1().data());
49 //!!! what to do if mkpath fails?
50 if (!logdir.exists()) logdir.mkpath(logdir.path());
51 } 49 }
50
51 //!!! what to do if mkpath fails?
52 if (!logdir.exists()) logdir.mkpath(logdir.path());
52 53
53 if (!debugs.hasLocalData()) { 54 if (!debugs.hasLocalData()) {
54 QFile *logFile = new QFile(logdir.path() + "/sv-debug.log"); 55 QFile *logFile = new QFile(logdir.path() + "/sv-debug.log");
55 if (logFile->open(QIODevice::WriteOnly | QIODevice::Append)) { 56 if (logFile->open(QIODevice::WriteOnly | QIODevice::Append)) {
56 QDebug(QtDebugMsg) << (const char *)prefix 57 QDebug(QtDebugMsg) << (const char *)prefix