refs #450 Changed path for log files in accordance with our new directory structure.

This commit is contained in:
Mathew Sutcliffe
2015-09-05 17:52:56 +01:00
parent f872186866
commit af3775c8ea
2 changed files with 3 additions and 1 deletions

View File

@@ -84,7 +84,8 @@ namespace BlackGui
} }
// File logger // File logger
CFileLogger *fileLogger = new CFileLogger(applicationName, QString(), &a); static const QString logPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/org.swift-project/logs";
CFileLogger *fileLogger = new CFileLogger(applicationName, logPath, &a);
fileLogger->changeLogPattern(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo)); fileLogger->changeLogPattern(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
// GUI icon // GUI icon

View File

@@ -26,6 +26,7 @@ namespace BlackMisc
m_applicationName(applicationName), m_applicationName(applicationName),
m_logPath(logPath) m_logPath(logPath)
{ {
if (!m_logPath.isEmpty()) { QDir::root().mkpath(m_logPath); }
removeOldLogFiles(); removeOldLogFiles();
if (!m_logPath.isEmpty() && !m_logPath.endsWith('/')) { m_logPath += '/'; } if (!m_logPath.isEmpty() && !m_logPath.endsWith('/')) { m_logPath += '/'; }
m_logFile.setFileName(getFullFileName()); m_logFile.setFileName(getFullFileName());