After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675790 - js: Don't use global.log*
js: Don't use global.log*
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-10 01:42 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-18 20:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
js: Don't use global.log* (4.69 KB, patch)
2012-05-10 01:42 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
extensionSystem: Don't spam stdout with "Loaded extension" (739 bytes, patch)
2012-05-10 01:42 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
js: Don't use global.log* (4.70 KB, patch)
2012-05-10 19:15 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
js: Don't use global.log* (4.86 KB, patch)
2012-05-10 21:04 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-05-10 01:42:09 UTC
See patches.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-05-10 01:42:11 UTC
Created attachment 213779 [details] [review]
js: Don't use global.log*

These are "deprecated", and are just references to the gjs logging functoins
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-05-10 01:42:14 UTC
Created attachment 213780 [details] [review]
extensionSystem: Don't spam stdout with "Loaded extension"
Comment 3 Giovanni Campagna 2012-05-10 16:14:50 UTC
Review of attachment 213779 [details] [review]:

::: js/extensionPrefs/main.js
@@ +211,3 @@
                 extension = ExtensionUtils.createExtensionObject(uuid, dir, type);
             } catch(e) {
+                logError('' + e);

logError wants an exception object and a message

::: js/misc/extensionUtils.js
@@ +158,3 @@
             userExtensionsDir.make_directory_with_parents(null);
     } catch (e) {
+        logError('' + e);

Same here.

::: js/ui/main.js
@@ +876,3 @@
     let data = _deferredWorkData[workId];
     if (!data) {
+        log('invalid work id ', workId);

It probably makes sense to emphasize this in logs (it is a programmer error somewhere, not an external condition)

::: js/ui/search.js
@@ +355,3 @@
                     provider.getSubsearchResultSet(previousResults, terms);
                 } catch (error) {
+                    log('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message);

What about logError, to get useful stack traces?
Comment 4 Giovanni Campagna 2012-05-10 16:15:15 UTC
Review of attachment 213780 [details] [review]:

Definitely makes sense.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-05-10 19:15:22 UTC
Created attachment 213832 [details] [review]
js: Don't use global.log*

These are "deprecated", and are just references to the gjs logging functoins



Not sure what you wanted me to do about the work ID, so I created an error
and logged it. Is this enough?
Comment 6 Giovanni Campagna 2012-05-10 19:47:11 UTC
Review of attachment 213832 [details] [review]:

Almost there...

(actually, good to go, just put something into logError)

::: js/extensionPrefs/main.js
@@ +211,3 @@
                 extension = ExtensionUtils.createExtensionObject(uuid, dir, type);
             } catch(e) {
+                logError(e);

logError() wants both an error and a string

::: js/ui/main.js
@@ +876,3 @@
     let data = _deferredWorkData[workId];
     if (!data) {
+        logError(new Error('Invalid work id %d'.format(workId)));

I just meant to add some ERROR indicator in front of it, but this works too.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-05-10 21:04:56 UTC
Created attachment 213839 [details] [review]
js: Don't use global.log*

These are "deprecated", and are just references to the gjs logging functoins



I should probably actually attempt to read the API rather than blindly
guessing one of these days.
Comment 8 drago01 2012-05-18 19:56:38 UTC
Review of attachment 213839 [details] [review]:

LG.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-05-18 20:03:03 UTC
Attachment 213780 [details] pushed as 3a01aaf - extensionSystem: Don't spam stdout with "Loaded extension"
Attachment 213839 [details] pushed as ce041a3 - js: Don't use global.log*