From 9bcb822963fc96c94dbe7dcc4134dcd2dac454ff Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Jul 2016 16:06:01 +0200 Subject: Prepared sinksh trace --- common/log.cpp | 6 ++++++ common/log.h | 2 ++ common/test.cpp | 1 + 3 files changed, 9 insertions(+) (limited to 'common') 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 config() return QSharedPointer::create(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/sink/log.ini", QSettings::IniFormat); } +static QByteArray sPrimaryComponent; +void Sink::Log::setPrimaryComponent(const QString &component) +{ + sPrimaryComponent = component.toUtf8(); +} + class DebugStream : public QIODevice { 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 Error }; +void SINK_EXPORT setPrimaryComponent(const QString &component); + QByteArray SINK_EXPORT debugLevelName(DebugLevel debugLevel); DebugLevel SINK_EXPORT debugLevelFromName(const QByteArray &name); 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() QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).removeRecursively(); // qDebug() << "Removing " << QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); QDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)).removeRecursively(); + Log::setPrimaryComponent("test"); } void Sink::Test::setTestModeEnabled(bool enabled) -- cgit v1.2.3