GNOME Bugzilla – Bug 675790
js: Don't use global.log*
Last modified: 2012-05-18 20:03:09 UTC
See patches.
Created attachment 213779 [details] [review] js: Don't use global.log* These are "deprecated", and are just references to the gjs logging functoins
Created attachment 213780 [details] [review] extensionSystem: Don't spam stdout with "Loaded extension"
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?
Review of attachment 213780 [details] [review]: Definitely makes sense.
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?
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.
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.
Review of attachment 213839 [details] [review]: LG.
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*