From 279c3fd398546eb6ed8cfb950b040e47a36e6711 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 6 Mar 2017 15:10:47 +0100 Subject: Index debug output --- common/index.cpp | 16 ++++++++-------- common/index.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/index.cpp b/common/index.cpp index f09e265..725c28b 100644 --- a/common/index.cpp +++ b/common/index.cpp @@ -2,31 +2,31 @@ #include "log.h" -SINK_DEBUG_AREA("index") - Index::Index(const QString &storageRoot, const QString &name, Sink::Storage::DataStore::AccessMode mode) : mTransaction(Sink::Storage::DataStore(storageRoot, name, mode).createTransaction(mode)), mDb(mTransaction.openDatabase(name.toLatin1(), std::function(), true)), - mName(name) + mName(name), + mLogCtx("index." + name.toLatin1()) { } Index::Index(const QByteArray &name, Sink::Storage::DataStore::Transaction &transaction) - : mDb(transaction.openDatabase(name, std::function(), true)), mName(name) + : mDb(transaction.openDatabase(name, std::function(), true)), mName(name), + mLogCtx("index." + name) { } void Index::add(const QByteArray &key, const QByteArray &value) { mDb.write(key, value, [&] (const Sink::Storage::DataStore::Error &error) { - SinkWarning() << "Error while writing value" << error; + SinkWarningCtx(mLogCtx) << "Error while writing value" << error; }); } void Index::remove(const QByteArray &key, const QByteArray &value) { mDb.remove(key, value, [&] (const Sink::Storage::DataStore::Error &error) { - SinkWarning() << "Error while removing value: " << key << value << error << error.store; + SinkWarningCtx(mLogCtx) << "Error while removing value: " << key << value << error; }); } @@ -38,7 +38,7 @@ void Index::lookup(const QByteArray &key, const std::function