Merge lp:~dandrader/qtmir/reduceLogVerbosity into lp:qtmir

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Gerry Boland
Approved revision: 597
Merged at revision: 614
Proposed branch: lp:~dandrader/qtmir/reduceLogVerbosity
Merge into: lp:qtmir
Diff against target: 302 lines (+34/-32)
3 files modified
src/modules/Unity/Application/application.cpp (+14/-13)
src/modules/Unity/Application/mirsurface.cpp (+17/-16)
src/platforms/mirserver/logging.cpp (+3/-3)
To merge this branch: bzr merge lp:~dandrader/qtmir/reduceLogVerbosity
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Approve
Gerry Boland (community) Approve
Review via email: mp+316634@code.launchpad.net

Commit message

Reduce default log verbosity

Debug messages won't be logged by default. Only from Informational level and up.
Most debug messages were transformed into informational, but some verbose ones were left as debug (such as window resize and reposition)

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No

* Did you perform an exploratory manual test run of your code change and any related functionality?
N/A

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

ok

review: Approve
597. By Daniel d'Andrada

make MirSurface::setCursor a debug message, so no logged by default

Revision history for this message
Gerry Boland (gerboland) :
review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:597
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/538/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4258
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4286
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4120/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4120/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4120/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4120/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4120/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4120
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4120/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/538/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application.cpp'
2--- src/modules/Unity/Application/application.cpp 2017-02-02 09:36:07 +0000
3+++ src/modules/Unity/Application/application.cpp 2017-02-23 11:42:35 +0000
4@@ -36,6 +36,7 @@
5 namespace unityapp = unity::shell::application;
6
7 #define DEBUG_MSG qCDebug(QTMIR_APPLICATIONS).nospace() << "Application[" << appId() <<"]::" << __func__
8+#define INFO_MSG qCInfo(QTMIR_APPLICATIONS).nospace() << "Application[" << appId() <<"]::" << __func__
9
10 namespace qtmir
11 {
12@@ -59,7 +60,7 @@
13 , m_proxySurfaceList(new ProxySurfaceListModel(this))
14 , m_proxyPromptSurfaceList(new ProxySurfaceListModel(this))
15 {
16- DEBUG_MSG << "()";
17+ INFO_MSG << "()";
18
19 // Because m_state is InternalState::Starting
20 acquireWakelock();
21@@ -75,7 +76,7 @@
22
23 Application::~Application()
24 {
25- DEBUG_MSG << "()";
26+ INFO_MSG << "()";
27
28 // (ricmm) -- To be on the safe side, better wipe the application QML compile cache if it crashes on startup
29 if (m_processState == Application::ProcessUnknown) {
30@@ -276,7 +277,7 @@
31 return;
32 }
33
34- DEBUG_MSG << "(requestedState=" << applicationStateToStr(value) << ")";
35+ INFO_MSG << "(requestedState=" << applicationStateToStr(value) << ")";
36
37 m_requestedState = value;
38 Q_EMIT requestedStateChanged(m_requestedState);
39@@ -430,7 +431,7 @@
40
41 void Application::close()
42 {
43- DEBUG_MSG << "()";
44+ INFO_MSG << "()";
45
46 switch (m_state) {
47 case InternalState::Starting:
48@@ -478,7 +479,7 @@
49
50 void Application::setSession(SessionInterface *newSession)
51 {
52- DEBUG_MSG << "(session=" << newSession << ")";
53+ INFO_MSG << "(session=" << newSession << ")";
54
55 if (newSession == m_session)
56 return;
57@@ -547,7 +548,7 @@
58 return;
59 }
60
61- DEBUG_MSG << "(state=" << internalStateToStr(state) << ")";
62+ INFO_MSG << "(state=" << internalStateToStr(state) << ")";
63
64 auto oldPublicState = this->state();
65 m_state = state;
66@@ -642,7 +643,7 @@
67
68 void Application::suspend()
69 {
70- DEBUG_MSG << "()";
71+ INFO_MSG << "()";
72
73 Q_ASSERT(m_state == InternalState::Running);
74 Q_ASSERT(m_session != nullptr);
75@@ -660,7 +661,7 @@
76
77 void Application::resume()
78 {
79- DEBUG_MSG << "()";
80+ INFO_MSG << "()";
81
82 if (m_state == InternalState::Suspended || m_state == InternalState::SuspendingWaitProcess) {
83 Q_EMIT resumeProcessRequested();
84@@ -681,7 +682,7 @@
85
86 void Application::respawn()
87 {
88- DEBUG_MSG << "()";
89+ INFO_MSG << "()";
90
91 setInternalState(InternalState::Starting);
92
93@@ -690,7 +691,7 @@
94
95 void Application::stop()
96 {
97- DEBUG_MSG << "()";
98+ INFO_MSG << "()";
99
100 Q_EMIT stopProcessRequested();
101 }
102@@ -709,7 +710,7 @@
103 {
104 if (m_exemptFromLifecycle != exemptFromLifecycle)
105 {
106- DEBUG_MSG << "(" << exemptFromLifecycle << ")";
107+ INFO_MSG << "(" << exemptFromLifecycle << ")";
108 // We don't adjust current suspension state, we only care about exempt
109 // status going into a suspend.
110 m_exemptFromLifecycle = exemptFromLifecycle;
111@@ -868,11 +869,11 @@
112 void Application::requestFocus()
113 {
114 if (m_proxySurfaceList->rowCount() > 0) {
115- DEBUG_MSG << "() - Requesting focus for most recent app surface";
116+ INFO_MSG << "() - Requesting focus for most recent app surface";
117 auto surface = static_cast<MirSurfaceInterface*>(m_proxySurfaceList->get(0));
118 surface->requestFocus();
119 } else {
120- DEBUG_MSG << "() - emitting focusRequested()";
121+ INFO_MSG << "() - emitting focusRequested()";
122 Q_EMIT focusRequested();
123 }
124 }
125
126=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
127--- src/modules/Unity/Application/mirsurface.cpp 2017-02-09 11:01:37 +0000
128+++ src/modules/Unity/Application/mirsurface.cpp 2017-02-23 11:42:35 +0000
129@@ -51,6 +51,7 @@
130 namespace unityapi = unity::shell::application;
131
132 #define DEBUG_MSG qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() << "]::" << __func__
133+#define INFO_MSG qCInfo(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() << "]::" << __func__
134 #define WARNING_MSG qCWarning(QTMIR_SURFACES).nospace() << "MirSurface[" << (void*)this << "," << appId() << "]::" << __func__
135
136 namespace {
137@@ -138,7 +139,7 @@
138 , m_parentSurface(parentSurface)
139 , m_childSurfaceList(new MirSurfaceListModel(this))
140 {
141- DEBUG_MSG << "("
142+ INFO_MSG << "("
143 << "type=" << mirSurfaceTypeToStr(m_type)
144 << ",state=" << unityapiMirStateToStr(m_state)
145 << ",size=(" << m_size.width() << "," << m_size.height() << ")"
146@@ -204,7 +205,7 @@
147
148 MirSurface::~MirSurface()
149 {
150- DEBUG_MSG << "() viewCount=" << m_views.count();
151+ INFO_MSG << "() viewCount=" << m_views.count();
152
153 Q_ASSERT(m_views.isEmpty());
154
155@@ -407,7 +408,7 @@
156 if (m_focused == value)
157 return;
158
159- DEBUG_MSG << "(" << value << ")";
160+ INFO_MSG << "(" << value << ")";
161
162 m_focused = value;
163 Q_EMIT focusedChanged(value);
164@@ -438,7 +439,7 @@
165 // Temporary hotfix for http://pad.lv/1483752
166 if (m_session->childSessions()->rowCount() > 0) {
167 // has child trusted session, ignore any focus change attempts
168- DEBUG_MSG << "() has child trusted session, ignore any focus change attempts";
169+ INFO_MSG << "() has child trusted session, ignore any focus change attempts";
170 return;
171 }
172
173@@ -472,7 +473,7 @@
174 return;
175 }
176
177- DEBUG_MSG << "()";
178+ INFO_MSG << "()";
179
180 m_closingState = Closing;
181 Q_EMIT closeRequested();
182@@ -575,14 +576,14 @@
183
184 void MirSurface::requestState(Mir::State state)
185 {
186- DEBUG_MSG << "(" << unityapiMirStateToStr(state) << ")";
187+ INFO_MSG << "(" << unityapiMirStateToStr(state) << ")";
188 m_controller->requestState(m_window, state);
189 }
190
191 void MirSurface::setLive(bool value)
192 {
193 if (value != m_live) {
194- DEBUG_MSG << "(" << value << ")";
195+ INFO_MSG << "(" << value << ")";
196 m_live = value;
197 Q_EMIT liveChanged(value);
198 if (m_views.isEmpty() && !m_live) {
199@@ -700,7 +701,7 @@
200 void MirSurface::registerView(qintptr viewId)
201 {
202 m_views.insert(viewId, MirSurface::View{false});
203- DEBUG_MSG << "(" << viewId << ")" << " after=" << m_views.count();
204+ INFO_MSG << "(" << viewId << ")" << " after=" << m_views.count();
205 if (m_views.count() == 1) {
206 Q_EMIT isBeingDisplayedChanged();
207 }
208@@ -709,7 +710,7 @@
209 void MirSurface::unregisterView(qintptr viewId)
210 {
211 m_views.remove(viewId);
212- DEBUG_MSG << "(" << viewId << ")" << " after=" << m_views.count() << " live=" << m_live;
213+ INFO_MSG << "(" << viewId << ")" << " after=" << m_views.count() << " live=" << m_live;
214 if (m_views.count() == 0) {
215 Q_EMIT isBeingDisplayedChanged();
216 if (m_session.isNull() || !m_live) {
217@@ -746,7 +747,7 @@
218 const bool oldExposed = (m_surface->query(mir_window_attrib_visibility) == mir_window_visibility_exposed);
219
220 if (newExposed != oldExposed) {
221- DEBUG_MSG << "(" << newExposed << ")";
222+ INFO_MSG << "(" << newExposed << ")";
223
224 m_surface->configure(mir_window_attrib_visibility,
225 newExposed ? mir_window_visibility_exposed : mir_window_visibility_occluded);
226@@ -791,7 +792,7 @@
227 return;
228 }
229
230- DEBUG_MSG << "(" << layoutPlusVariant << ")";
231+ INFO_MSG << "(" << layoutPlusVariant << ")";
232
233 m_keymap = layoutPlusVariant;
234 Q_EMIT keymapChanged(m_keymap);
235@@ -865,7 +866,7 @@
236 if (newState == m_state) {
237 return;
238 }
239- DEBUG_MSG << "(" << unityapiMirStateToStr(newState) << ")";
240+ INFO_MSG << "(" << unityapiMirStateToStr(newState) << ")";
241
242 m_state = newState;
243 Q_EMIT stateChanged(state());
244@@ -877,7 +878,7 @@
245 void MirSurface::setReady()
246 {
247 if (!m_ready) {
248- DEBUG_MSG << "()";
249+ INFO_MSG << "()";
250 m_ready = true;
251 updateVisible(); // as Mir can change m_surface->visible() to true after first frame swap
252 Q_EMIT ready();
253@@ -940,7 +941,7 @@
254
255 void MirSurface::activate()
256 {
257- DEBUG_MSG << "()";
258+ INFO_MSG << "()";
259 if (m_live) {
260 m_controller->activate(m_window);
261 }
262@@ -950,7 +951,7 @@
263 {
264 Q_ASSERT(m_closingState == Closing);
265
266- DEBUG_MSG << "()";
267+ INFO_MSG << "()";
268
269 m_closingState = CloseOverdue;
270
271@@ -1212,7 +1213,7 @@
272
273 void MirSurface::requestFocus()
274 {
275- DEBUG_MSG << "()";
276+ INFO_MSG << "()";
277 Q_EMIT focusRequested();
278 }
279
280
281=== modified file 'src/platforms/mirserver/logging.cpp'
282--- src/platforms/mirserver/logging.cpp 2016-09-29 15:46:59 +0000
283+++ src/platforms/mirserver/logging.cpp 2017-02-23 11:42:35 +0000
284@@ -1,5 +1,5 @@
285 /*
286- * Copyright (C) 2016 Canonical, Ltd.
287+ * Copyright (C) 2016,2017 Canonical, Ltd.
288 *
289 * This program is free software: you can redistribute it and/or modify it under
290 * the terms of the GNU Lesser General Public License version 3, as published by
291@@ -16,9 +16,9 @@
292
293 #include "logging.h"
294
295-Q_LOGGING_CATEGORY(QTMIR_APPLICATIONS, "qtmir.applications")
296+Q_LOGGING_CATEGORY(QTMIR_APPLICATIONS, "qtmir.applications", QtInfoMsg)
297 Q_LOGGING_CATEGORY(QTMIR_SESSIONS, "qtmir.sessions")
298-Q_LOGGING_CATEGORY(QTMIR_SURFACES, "qtmir.surfaces")
299+Q_LOGGING_CATEGORY(QTMIR_SURFACES, "qtmir.surfaces", QtInfoMsg)
300 Q_LOGGING_CATEGORY(QTMIR_MIR_INPUT, "qtmir.mir.input", QtWarningMsg)
301 Q_LOGGING_CATEGORY(QTMIR_MIR_MESSAGES, "qtmir.mir")
302 Q_LOGGING_CATEGORY(QTMIR_MIR_KEYMAP, "qtmir.mir.keymap")

Subscribers

People subscribed via source and target branches