summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/log.cpp6
-rw-r--r--common/log.h2
-rw-r--r--common/test.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/common/log.cpp b/common/log.cpp
index b0f6237..83cdc8a 100644
--- a/common/log.cpp
+++ b/common/log.cpp
@@ -16,6 +16,12 @@ static QSharedPointer<QSettings> config()
16 return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/log.ini", QSettings::IniFormat); 16 return QSharedPointer<QSettings>::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/log.ini", QSettings::IniFormat);
17} 17}
18 18
19static QByteArray sPrimaryComponent;
20void Sink::Log::setPrimaryComponent(const QString &component)
21{
22 sPrimaryComponent = component.toUtf8();
23}
24
19class DebugStream : public QIODevice 25class DebugStream : public QIODevice
20{ 26{
21public: 27public:
diff --git a/common/log.h b/common/log.h
index 0e92ea9..36b8efe 100644
--- a/common/log.h
+++ b/common/log.h
@@ -14,6 +14,8 @@ enum DebugLevel
14 Error 14 Error
15}; 15};
16 16
17void SINK_EXPORT setPrimaryComponent(const QString &component);
18
17QByteArray SINK_EXPORT debugLevelName(DebugLevel debugLevel); 19QByteArray SINK_EXPORT debugLevelName(DebugLevel debugLevel);
18DebugLevel SINK_EXPORT debugLevelFromName(const QByteArray &name); 20DebugLevel SINK_EXPORT debugLevelFromName(const QByteArray &name);
19 21
diff --git a/common/test.cpp b/common/test.cpp
index 59ad9ec..c7d84cc 100644
--- a/common/test.cpp
+++ b/common/test.cpp
@@ -45,6 +45,7 @@ void Sink::Test::initTest()
45 QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).removeRecursively(); 45 QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).removeRecursively();
46 // qDebug() << "Removing " << QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); 46 // qDebug() << "Removing " << QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation);
47 QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)).removeRecursively(); 47 QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)).removeRecursively();
48 Log::setPrimaryComponent("test");
48} 49}
49 50
50void Sink::Test::setTestModeEnabled(bool enabled) 51void Sink::Test::setTestModeEnabled(bool enabled)