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 --- synchronizer/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'synchronizer') diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index 3168bfc..b3decf6 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp @@ -162,6 +162,7 @@ int main(int argc, char *argv[]) const QByteArray instanceIdentifier = arguments.at(1); const QByteArray resourceType = arguments.at(2); app.setApplicationName(instanceIdentifier); + Sink::Log::setPrimaryComponent(instanceIdentifier); Log() << "Starting: " << instanceIdentifier; QLockFile lockfile(instanceIdentifier + ".lock"); -- cgit v1.2.3 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. --- synchronizer/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'synchronizer') diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index b3decf6..e9dd6cb 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp @@ -34,8 +34,7 @@ #include "log.h" #include "test.h" -#undef DEBUG_AREA -#define DEBUG_AREA "resource" +SINK_DEBUG_AREA("main") static Listener *listener = nullptr; @@ -149,13 +148,13 @@ int main(int argc, char *argv[]) arguments << argv[i]; } if (arguments.contains("--test")) { - Log() << "Running in test-mode"; + SinkLog() << "Running in test-mode"; arguments.removeAll("--test"); Sink::Test::setTestModeEnabled(true); } if (arguments.count() < 3) { - Warning() << "Not enough args passed, no resource loaded."; + SinkWarning() << "Not enough args passed, no resource loaded."; return app.exec(); } @@ -163,12 +162,12 @@ int main(int argc, char *argv[]) const QByteArray resourceType = arguments.at(2); app.setApplicationName(instanceIdentifier); Sink::Log::setPrimaryComponent(instanceIdentifier); - Log() << "Starting: " << instanceIdentifier; + SinkLog() << "Starting: " << instanceIdentifier; QLockFile lockfile(instanceIdentifier + ".lock"); lockfile.setStaleLockTime(500); if (!lockfile.tryLock(0)) { - Warning() << "Failed to acquire exclusive lock on socket."; + SinkWarning() << "Failed to acquire exclusive lock on socket."; return -1; } @@ -178,6 +177,6 @@ int main(int argc, char *argv[]) QObject::connect(listener, &Listener::noClients, &app, &QCoreApplication::quit); auto ret = app.exec(); - Log() << "Exiting: " << instanceIdentifier; + SinkLog() << "Exiting: " << instanceIdentifier; return ret; } -- cgit v1.2.3