Merge lp:~mardy/online-accounts-api/debug-1638166 into lp:online-accounts-api

Proposed by Alberto Mardegan
Status: Merged
Approved by: Alberto Mardegan
Approved revision: 36
Merged at revision: 36
Proposed branch: lp:~mardy/online-accounts-api/debug-1638166
Merge into: lp:online-accounts-api
Diff against target: 99 lines (+19/-5)
5 files modified
src/lib/OnlineAccounts/CMakeLists.txt (+4/-0)
src/lib/OnlineAccounts/authentication_reply.cpp (+4/-3)
src/lib/OnlineAccounts/global.h (+5/-0)
src/lib/OnlineAccounts/manager.cpp (+4/-1)
src/lib/OnlineAccounts/request_access_reply.cpp (+2/-1)
To merge this branch: bzr merge lp:~mardy/online-accounts-api/debug-1638166
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
Review via email: mp+309742@code.launchpad.net

Commit message

Disable debug output by default

Use QT logging by category functionality, so that logging can be turned on by either an environment variable or via a config file.

Description of the change

Disable debug output by default

Use QT logging by category functionality, so that logging can be turned on by either an environment variable or via a config file.

To post a comment you must log in.
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/lib/OnlineAccounts/CMakeLists.txt'
--- src/lib/OnlineAccounts/CMakeLists.txt 2015-09-03 13:28:30 +0000
+++ src/lib/OnlineAccounts/CMakeLists.txt 2016-11-01 11:05:36 +0000
@@ -8,6 +8,10 @@
8set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")8set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
9set(CMAKE_CXX_VISIBILITY_PRESET hidden)9set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1010
11add_definitions(
12 -DBUILDING_ONLINE_ACCOUNTS
13)
14
11add_library(${CLIENT_LIB} SHARED15add_library(${CLIENT_LIB} SHARED
12 account.cpp16 account.cpp
13 account_info.cpp17 account_info.cpp
1418
=== modified file 'src/lib/OnlineAccounts/authentication_reply.cpp'
--- src/lib/OnlineAccounts/authentication_reply.cpp 2016-01-13 14:23:12 +0000
+++ src/lib/OnlineAccounts/authentication_reply.cpp 2016-11-01 11:05:36 +0000
@@ -50,7 +50,8 @@
50 return QVariant::fromValue(arrayList);50 return QVariant::fromValue(arrayList);
51 } else {51 } else {
52 /* We don't know how to handle other types */52 /* We don't know how to handle other types */
53 qWarning() << "unhandled type" << argument.currentSignature();53 qCWarning(DBG_ONLINE_ACCOUNTS) << "unhandled type" <<
54 argument.currentSignature();
54 return argument.asVariant();55 return argument.asVariant();
55 }56 }
56 } else {57 } else {
@@ -133,7 +134,7 @@
133 } else {134 } else {
134 qFatal("Unknown invoked method %d", invokedMethod);135 qFatal("Unknown invoked method %d", invokedMethod);
135 }136 }
136 qDebug() << "reply data:" << m_replyData;137 qCDebug(DBG_ONLINE_ACCOUNTS) << "reply data:" << m_replyData;
137}138}
138139
139AuthenticationReply::AuthenticationReply(const PendingCall &call):140AuthenticationReply::AuthenticationReply(const PendingCall &call):
@@ -264,7 +265,7 @@
264 case ONLINE_ACCOUNTS_AUTH_SASL_STATE_FINISHED: return Finished;265 case ONLINE_ACCOUNTS_AUTH_SASL_STATE_FINISHED: return Finished;
265 case ONLINE_ACCOUNTS_AUTH_SASL_STATE_CONTINUE: return Continue;266 case ONLINE_ACCOUNTS_AUTH_SASL_STATE_CONTINUE: return Continue;
266 default:267 default:
267 qWarning() << "Unknown SASL state" << state;268 qCWarning(DBG_ONLINE_ACCOUNTS) << "Unknown SASL state" << state;
268 return Finished;269 return Finished;
269 }270 }
270}271}
271272
=== modified file 'src/lib/OnlineAccounts/global.h'
--- src/lib/OnlineAccounts/global.h 2016-01-13 14:23:12 +0000
+++ src/lib/OnlineAccounts/global.h 2016-11-01 11:05:36 +0000
@@ -29,6 +29,11 @@
29# define ONLINE_ACCOUNTS_EXPORT Q_DECL_IMPORT29# define ONLINE_ACCOUNTS_EXPORT Q_DECL_IMPORT
30#endif30#endif
3131
32#if defined(BUILDING_ONLINE_ACCOUNTS)
33#include <QLoggingCategory>
34Q_DECLARE_LOGGING_CATEGORY(DBG_ONLINE_ACCOUNTS)
35#endif
36
32namespace OnlineAccounts {37namespace OnlineAccounts {
3338
34typedef uint AccountId;39typedef uint AccountId;
3540
=== modified file 'src/lib/OnlineAccounts/manager.cpp'
--- src/lib/OnlineAccounts/manager.cpp 2016-07-22 05:08:06 +0000
+++ src/lib/OnlineAccounts/manager.cpp 2016-11-01 11:05:36 +0000
@@ -31,6 +31,8 @@
3131
32using namespace OnlineAccounts;32using namespace OnlineAccounts;
3333
34Q_LOGGING_CATEGORY(DBG_ONLINE_ACCOUNTS, "OnlineAccounts", QtWarningMsg)
35
34ManagerPrivate::ManagerPrivate(Manager *q, const QString &applicationId,36ManagerPrivate::ManagerPrivate(Manager *q, const QString &applicationId,
35 const QDBusConnection& bus):37 const QDBusConnection& bus):
36 QObject(),38 QObject(),
@@ -125,7 +127,8 @@
125127
126 QDBusPendingReply<QList<AccountInfo> > reply = *m_getAccountsCall;128 QDBusPendingReply<QList<AccountInfo> > reply = *m_getAccountsCall;
127 if (Q_UNLIKELY(reply.isError())) {129 if (Q_UNLIKELY(reply.isError())) {
128 qWarning() << "GetAccounts call failed:" << reply.error();130 qCWarning(DBG_ONLINE_ACCOUNTS) << "GetAccounts call failed:" <<
131 reply.error();
129 /* No special handling of the error: the Manager will simply not have132 /* No special handling of the error: the Manager will simply not have
130 * any account */133 * any account */
131 } else {134 } else {
132135
=== modified file 'src/lib/OnlineAccounts/request_access_reply.cpp'
--- src/lib/OnlineAccounts/request_access_reply.cpp 2015-03-04 10:01:32 +0000
+++ src/lib/OnlineAccounts/request_access_reply.cpp 2016-11-01 11:05:36 +0000
@@ -57,7 +57,8 @@
5757
58 if (Q_UNLIKELY(pCall->dbusCall().isError())) {58 if (Q_UNLIKELY(pCall->dbusCall().isError())) {
59 /* Treat all errors as permission denied. */59 /* Treat all errors as permission denied. */
60 qWarning() << "Error:" << pCall->dbusCall().error().message();60 qCWarning(DBG_ONLINE_ACCOUNTS) << "Error:" <<
61 pCall->dbusCall().error().message();
61 m_error = Error(Error::PermissionDenied,62 m_error = Error(Error::PermissionDenied,
62 pCall->dbusCall().error().message());63 pCall->dbusCall().error().message());
63 return;64 return;

Subscribers

People subscribed via source and target branches