From da2b049e248c1ad7efeb53685158a205335e4e36 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Jul 2016 22:23:49 +0200 Subject: A new debug system. Instead of a single #define as debug area the new system allows for an identifier for each debug message with the structure component.area. The component is a dot separated identifier of the runtime component, such as the process or the plugin. The area is the code component, and can be as such defined at compiletime. The idea of this system is that it becomes possible to i.e. look at the output of all messages in the query subsystem of a specific resource (something that happens in the client process, but in the resource-specific subcomponent). The new macros are supposed to be less likely to clash with other names, hence the new names. --- common/domainadaptor.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'common/domainadaptor.h') diff --git a/common/domainadaptor.h b/common/domainadaptor.h index 8ac8171..25448f3 100644 --- a/common/domainadaptor.h +++ b/common/domainadaptor.h @@ -47,12 +47,12 @@ createBufferPart(const Sink::ApplicationDomain::ApplicationDomainType &domainObj // First create a primitives such as strings using the mappings QList> propertiesToAddToResource; for (const auto &property : domainObject.changedProperties()) { - // Trace() << "copying property " << property; + // SinkTrace() << "copying property " << property; const auto value = domainObject.getProperty(property); if (mapper.hasMapping(property)) { mapper.setProperty(property, domainObject.getProperty(property), propertiesToAddToResource, fbb); } else { - // Trace() << "no mapping for property available " << property; + // SinkTrace() << "no mapping for property available " << property; } } @@ -79,7 +79,7 @@ static void createBufferPartBuffer(const Sink::ApplicationDomain::ApplicationDom fbb.Finish(pos, "AKFB"); flatbuffers::Verifier verifier(fbb.GetBufferPointer(), fbb.GetSize()); if (!verifier.VerifyBuffer()) { - Warning() << "Created invalid uffer"; + SinkWarning_(0, "bufferadaptor") << "Created invalid uffer"; } } @@ -89,6 +89,7 @@ static void createBufferPartBuffer(const Sink::ApplicationDomain::ApplicationDom template class GenericBufferAdaptor : public Sink::ApplicationDomain::BufferAdaptor { + SINK_DEBUG_AREA("bufferadaptor") public: GenericBufferAdaptor() : BufferAdaptor() { @@ -96,7 +97,7 @@ public: virtual void setProperty(const QByteArray &key, const QVariant &value) Q_DECL_OVERRIDE { - Warning() << "Can't set property " << key; + SinkWarning() << "Can't set property " << key; Q_ASSERT(false); } @@ -107,7 +108,7 @@ public: } else if (mLocalBuffer && mLocalMapper->hasMapping(key)) { return mLocalMapper->getProperty(key, mLocalBuffer); } - Warning() << "No mapping available for key " << key << mLocalBuffer << mResourceBuffer; + SinkWarning() << "No mapping available for key " << key << mLocalBuffer << mResourceBuffer; return QVariant(); } @@ -168,13 +169,13 @@ public: { flatbuffers::FlatBufferBuilder localFbb; if (mLocalWriteMapper) { - // Trace() << "Creating local buffer part"; + // SinkTrace() << "Creating local buffer part"; createBufferPartBuffer(domainObject, localFbb, *mLocalWriteMapper); } flatbuffers::FlatBufferBuilder resFbb; if (mResourceWriteMapper) { - // Trace() << "Creating resouce buffer part"; + // SinkTrace() << "Creating resouce buffer part"; createBufferPartBuffer(domainObject, resFbb, *mResourceWriteMapper); } -- cgit v1.2.3