mirror of https://github.com/nymea/nymea.git
add guhsettings for log path
parent
85f6b441c9
commit
5d91331683
|
|
@ -121,11 +121,11 @@ QString GuhSettings::logPath()
|
|||
QString organisationName = QCoreApplication::instance()->organizationName();
|
||||
|
||||
if (organisationName == "guh-test") {
|
||||
logPath = QDir::homePath() + ".config/" + organisationName + "/guhd-test.log";
|
||||
logPath = "/tmp/guhd-test.log";
|
||||
} else if (GuhSettings::isRoot()) {
|
||||
logPath = "/var/log/guhd.log";
|
||||
} else {
|
||||
logPath = QDir::homePath() + ".config/" + organisationName + "/guhd.log";
|
||||
logPath = QDir::homePath() + "/.config/" + organisationName + "/guhd.log";
|
||||
}
|
||||
|
||||
return logPath;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "guhsettings.h"
|
||||
#include "logengine.h"
|
||||
#include "loggingcategories.h"
|
||||
#include "logging.h"
|
||||
|
|
@ -41,7 +42,9 @@ LogEngine::LogEngine(QObject *parent):
|
|||
{
|
||||
|
||||
m_db = QSqlDatabase::addDatabase("QSQLITE");
|
||||
m_db.setDatabaseName("/tmp/guhd.log");
|
||||
m_db.setDatabaseName(GuhSettings::logPath());
|
||||
|
||||
qCDebug(dcLogEngine) << "Opening logging database" << m_db.databaseName();
|
||||
|
||||
if (!m_db.isValid()) {
|
||||
qCWarning(dcLogEngine) << "Database not valid:" << m_db.lastError().driverText() << m_db.lastError().databaseText();
|
||||
|
|
|
|||
Loading…
Reference in New Issue