Merge lp:~justinmcp/unity-webapps-qml/logging into lp:unity-webapps-qml

Proposed by Justin McPherson
Status: Needs review
Proposed branch: lp:~justinmcp/unity-webapps-qml/logging
Merge into: lp:unity-webapps-qml
Diff against target: 92 lines (+37/-4)
3 files modified
src/Ubuntu/UnityWebApps/UnityWebApps.js (+8/-4)
src/Ubuntu/UnityWebApps/UnityWebApps.qml (+24/-0)
src/Ubuntu/UnityWebApps/unity-webapps-api.js.in (+5/-0)
To merge this branch: bzr merge lp:~justinmcp/unity-webapps-qml/logging
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
WebApps Pending
Review via email: mp+213586@code.launchpad.net

Commit message

- Enable display of logging information from the webbrowser app.
- Hide integration logging messages in the intergration category.

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

merge with trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
106. By Justin McPherson

merge from trunk

107. By Justin McPherson

merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

107. By Justin McPherson

merge from trunk

106. By Justin McPherson

merge from trunk

105. By Justin McPherson

merge with trunk

104. By Justin McPherson

Changes to logging.

- Rename property to loggingCategories
- Make dynamic

103. By Justin McPherson

Enable conditional logging.

Based on an array of strings. Each string represents the type of logging of
interest.

102. By Justin McPherson

Allow webapp logging through Unity.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.js'
--- src/Ubuntu/UnityWebApps/UnityWebApps.js 2014-03-18 18:52:11 +0000
+++ src/Ubuntu/UnityWebApps/UnityWebApps.js 2014-04-11 07:20:27 +0000
@@ -37,11 +37,11 @@
37 * \param userscriptContent37 * \param userscriptContent
38 */38 */
39 function _UnityWebApps(parentItem, bindeeProxies, backends, userscripts) {39 function _UnityWebApps(parentItem, bindeeProxies, backends, userscripts) {
40 this._parent = parentItem;
40 this._injected_unity_api_path = Qt.resolvedUrl('unity-webapps-api.js');41 this._injected_unity_api_path = Qt.resolvedUrl('unity-webapps-api.js');
41 this._bindeeProxies = bindeeProxies;42 this._bindeeProxies = bindeeProxies;
42 this._backends = backends;43 this._backends = backends;
43 this._userscripts = userscripts || [];44 this._userscripts = userscripts || [];
44
45 this._bind();45 this._bind();
46 };46 };
4747
@@ -247,10 +247,14 @@
247 *247 *
248 */248 */
249 _log: function (msg) {249 _log: function (msg) {
250 try {250 if (this._parent.loggingCategories !== undefined && this._parent.loggingCategories.length > 0) {
251 console.debug(msg);251 if (this._parent.loggingCategories.indexOf('integration') !== -1) {
252 try {
253 console.debug(msg);
254 }
255 catch(e) {}
256 }
252 }257 }
253 catch(e) {}
254 },258 },
255259
256 /**260 /**
257261
=== modified file 'src/Ubuntu/UnityWebApps/UnityWebApps.qml'
--- src/Ubuntu/UnityWebApps/UnityWebApps.qml 2014-03-26 15:52:46 +0000
+++ src/Ubuntu/UnityWebApps/UnityWebApps.qml 2014-04-11 07:20:27 +0000
@@ -144,6 +144,12 @@
144 */144 */
145 property var _opt_backendProxies: null145 property var _opt_backendProxies: null
146146
147 /*!
148 \qmlproperty var UnityWebApps::loggingCategories
149
150 An array of strings indicating logging types that should be enabled.
151 */
152 property var loggingCategories: []
147153
148 Settings {154 Settings {
149 id: settings155 id: settings
@@ -742,6 +748,24 @@
742 }748 }
743 },749 },
744 __actionNames: {}750 __actionNames: {}
751 },
752
753 Logger: {
754 info: function (strings) {
755 if (loggingCategories.length > 0 && loggingCategories.indexOf('web_console') !== -1) {
756 console.log("LOG: " + strings);
757 }
758 },
759 warning: function (strings) {
760 if (loggingCategories.length > 0 && loggingCategories.indexOf('web_console') !== -1) {
761 console.warn("WARNING: " + strings);
762 }
763 },
764 error: function (strings) {
765 if (loggingCategories.length > 0 && loggingCategories.indexOf('web_console') !== -1) {
766 console.error("ERROR: " + strings);
767 }
768 }
745 }769 }
746 };770 };
747 }771 }
748772
=== modified file 'src/Ubuntu/UnityWebApps/unity-webapps-api.js.in'
--- src/Ubuntu/UnityWebApps/unity-webapps-api.js.in 2014-03-26 15:52:46 +0000
+++ src/Ubuntu/UnityWebApps/unity-webapps-api.js.in 2014-04-11 07:20:27 +0000
@@ -282,6 +282,11 @@
282 AlarmApi: createAlarmApi(backend),282 AlarmApi: createAlarmApi(backend),
283 ContentHub: createContentHubApi(backend),283 ContentHub: createContentHubApi(backend),
284 RuntimeApi: createRuntimeApi(backend),284 RuntimeApi: createRuntimeApi(backend),
285 Logger: {
286 info: createArgumentsSanitizer (backend, [{ str: true }], 'Logger.info'),
287 warning: createArgumentsSanitizer (backend, [{ str: true }], 'Logger.warning'),
288 error: createArgumentsSanitizer (backend, [{ str: true }], 'Logger.error')
289 },
285 };290 };
286291
287 return api;292 return api;

Subscribers

People subscribed via source and target branches

to all changes: