Merge lp:~mardy/ubuntu-system-settings-online-accounts/logging-1570735 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Merged
Approved by: David Barth
Approved revision: 349
Merged at revision: 350
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/logging-1570735
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 68 lines (+12/-0)
2 files modified
online-accounts-service/main.cpp (+7/-0)
online-accounts-ui/main.cpp (+5/-0)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/logging-1570735
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Online Accounts Pending
Review via email: mp+291980@code.launchpad.net

Commit message

Allow configuring verbosity level from configuration file

Description of the change

Allow configuring verbosity level from configuration file

NOTE: this works fine under xenial, where systemd captures the output of the processes activated by D-Bus and sends it to the syslog. On vivid, systemd is not doing that, so even if the LoggingLevel=2 option is given, the output will be lost, unless the program is started from the command line.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online-accounts-service/main.cpp'
2--- online-accounts-service/main.cpp 2015-09-02 14:54:04 +0000
3+++ online-accounts-service/main.cpp 2016-04-15 08:27:43 +0000
4@@ -32,6 +32,7 @@
5 #include <QDBusMetaType>
6 #include <QLibrary>
7 #include <QProcessEnvironment>
8+#include <QSettings>
9
10 using namespace OnlineAccountsUi;
11
12@@ -43,6 +44,8 @@
13 {
14 QCoreApplication app(argc, argv);
15
16+ QSettings settings("online-accounts-service");
17+
18 /* read environment variables */
19 QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
20 if (environment.contains(QLatin1String("OAU_LOGGING_LEVEL"))) {
21@@ -51,6 +54,8 @@
22 QLatin1String("OAU_LOGGING_LEVEL")).toInt(&isOk);
23 if (isOk)
24 setLoggingLevel(value);
25+ } else {
26+ setLoggingLevel(settings.value("LoggingLevel", 1).toInt());
27 }
28
29 /* default daemonTimeout to 5 seconds */
30@@ -63,6 +68,8 @@
31 QLatin1String("OAU_DAEMON_TIMEOUT")).toInt(&isOk);
32 if (isOk)
33 daemonTimeout = value;
34+ } else {
35+ daemonTimeout = settings.value("DaemonTimeout", 5).toInt();
36 }
37
38 RequestManager *requestManager = new RequestManager();
39
40=== modified file 'online-accounts-ui/main.cpp'
41--- online-accounts-ui/main.cpp 2015-04-27 17:16:42 +0000
42+++ online-accounts-ui/main.cpp 2016-04-15 08:27:43 +0000
43@@ -26,6 +26,7 @@
44 #include <QGuiApplication>
45 #include <QLibrary>
46 #include <QProcessEnvironment>
47+#include <QSettings>
48 #include <sys/apparmor.h>
49
50 using namespace OnlineAccountsUi;
51@@ -56,6 +57,8 @@
52 }
53 }
54
55+ QSettings settings("online-accounts-service");
56+
57 /* read environment variables */
58 QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
59 if (environment.contains(QLatin1String("OAU_LOGGING_LEVEL"))) {
60@@ -64,6 +67,8 @@
61 QLatin1String("OAU_LOGGING_LEVEL")).toInt(&isOk);
62 if (isOk)
63 setLoggingLevel(value);
64+ } else {
65+ setLoggingLevel(settings.value("LoggingLevel", 1).toInt());
66 }
67
68 initTr(I18N_DOMAIN, NULL);

Subscribers

People subscribed via source and target branches