comparison base/Debug.cpp @ 1554:04a198887a3d

Datestamp debug log
author Chris Cannam
date Fri, 12 Oct 2018 11:00:01 +0100
parents 838a45cff62d
children 70e172e6cc59
comparison
equal deleted inserted replaced
1553:66c1988fc906 1554:04a198887a3d
18 18
19 #include <QMutex> 19 #include <QMutex>
20 #include <QDir> 20 #include <QDir>
21 #include <QUrl> 21 #include <QUrl>
22 #include <QCoreApplication> 22 #include <QCoreApplication>
23 #include <QDateTime>
23 24
24 #include <stdexcept> 25 #include <stdexcept>
25 26
26 static SVDebug *svdebug = 0; 27 static SVDebug *svdebug = 0;
27 static SVCerr *svcerr = 0; 28 static SVCerr *svcerr = 0;
80 if (!m_stream) { 81 if (!m_stream) {
81 QDebug(QtWarningMsg) << (const char *)m_prefix 82 QDebug(QtWarningMsg) << (const char *)m_prefix
82 << "Failed to open debug log file " 83 << "Failed to open debug log file "
83 << fileName << " for writing"; 84 << fileName << " for writing";
84 } else { 85 } else {
85 // cerr << m_prefix << ": Log file is " << fileName << endl;
86 m_ok = true; 86 m_ok = true;
87 (*this) << "Debug log started at "
88 << QDateTime::currentDateTime().toString() << endl;
87 } 89 }
88 } 90 }
89 91
90 SVDebug::~SVDebug() 92 SVDebug::~SVDebug()
91 { 93 {