diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/log.cpp | 6 | ||||
-rw-r--r-- | common/log.h | 2 | ||||
-rw-r--r-- | common/test.cpp | 1 |
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 | ||
19 | static QByteArray sPrimaryComponent; | ||
20 | void Sink::Log::setPrimaryComponent(const QString &component) | ||
21 | { | ||
22 | sPrimaryComponent = component.toUtf8(); | ||
23 | } | ||
24 | |||
19 | class DebugStream : public QIODevice | 25 | class DebugStream : public QIODevice |
20 | { | 26 | { |
21 | public: | 27 | public: |
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 | ||
17 | void SINK_EXPORT setPrimaryComponent(const QString &component); | ||
18 | |||
17 | QByteArray SINK_EXPORT debugLevelName(DebugLevel debugLevel); | 19 | QByteArray SINK_EXPORT debugLevelName(DebugLevel debugLevel); |
18 | DebugLevel SINK_EXPORT debugLevelFromName(const QByteArray &name); | 20 | DebugLevel 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 | ||
50 | void Sink::Test::setTestModeEnabled(bool enabled) | 51 | void Sink::Test::setTestModeEnabled(bool enabled) |