only use pid in log filename if app name is not set

This commit is contained in:
Patrick von Reth 2014-02-04 15:24:25 +01:00
parent f1b9c24dbd
commit f2459a4ae8
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ SnoreLog::SnoreLog(SnoreDebugLevels lvl):
SnoreLog::~SnoreLog() SnoreLog::~SnoreLog()
{ {
static std::ofstream m_logg(QString("%1/libsnore/%2-%3-log.txt").arg(QDir::tempPath(), qApp->applicationName(), QString::number(qApp->applicationPid())).toUtf8().constData()); static std::ofstream m_logg(QString("%1/libsnore/%2-log.txt").arg(QDir::tempPath(), qApp->applicationName().isEmpty()?QString::number(qApp->applicationPid()):qApp->applicationName()).toUtf8().constData());
static QMutex m_mutex; static QMutex m_mutex;
QMutexLocker lock(&m_mutex); QMutexLocker lock(&m_mutex);
if(debugLvl() >= m_lvl) if(debugLvl() >= m_lvl)