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 675104 - lookingGlass: Remove the Errors tab
lookingGlass: Remove the Errors tab
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-04-29 20:43 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-02 18:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
environment: Allow window.log and friends to take multiple arguments (1.33 KB, patch)
2012-04-29 20:43 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
lookingGlass: Remove the "Errors" tab (5.09 KB, patch)
2012-04-29 20:43 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
lookingGlass: Remove the "Errors" tab (5.35 KB, patch)
2012-04-29 20:47 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
environment: Allow window.log and friends to take multiple arguments (1.07 KB, patch)
2012-04-29 21:06 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
lookingGlass: Remove the "Errors" tab (5.58 KB, patch)
2012-04-29 21:06 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-04-29 20:43:42 UTC
We already have one too many logging systems, and we should reduce the
amount of random places to check in case something blows up.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-04-29 20:43:44 UTC
Created attachment 213063 [details] [review]
environment: Allow window.log and friends to take multiple arguments
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-04-29 20:43:47 UTC
Created attachment 213064 [details] [review]
lookingGlass: Remove the "Errors" tab

We already have one too many logging systems. Remove the errors tab
and make global.log/global.logError point to window.log/window.logError
instead.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-04-29 20:47:09 UTC
Created attachment 213065 [details] [review]
lookingGlass: Remove the "Errors" tab

We already have one too many logging systems. Remove the errors tab
and make global.log/global.logError point to window.log/window.logError
instead.
Comment 4 Giovanni Campagna 2012-04-29 20:48:11 UTC
Review of attachment 213063 [details] [review]:

::: js/ui/environment.js
@@ +44,3 @@
+function _makeLoggingFunc(func) {
+    return function() {
+        return func([].slice.apply(arguments).join(', '));

1) You don't need [].slice.apply, use Array.prototype.join.call.

(Ok, it's difficult to tell which one is more readable, but at least it skips allocating the Array)

2) This is will regress logError, as that takes an exception as first argument, so it must not be coerced into a string.

@@ +56,3 @@
+    window.logError = _makeLoggingFunc(window.logError);
+    window.print = _makeLoggingFunc(window.print);
+    window.printerr = _makeLoggingFunc(window.printerr);

Why print/printerr?
They're not part of the legacy logging system.
Comment 5 Giovanni Campagna 2012-04-29 20:56:51 UTC
Review of attachment 213065 [details] [review]:

You can remove _errorLogStack declaration too.

::: js/ui/main.js
@@ +155,3 @@
 function start() {
+    // These are here so we don't break compatibility.
+    global.logError = window.log;

Is it ok to have logError behave identically as log?

(I don't think anyone uses global.logError, btw)
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-04-29 20:59:11 UTC
(In reply to comment #5)
> Is it ok to have logError behave identically as log?

Oops.

> (I don't think anyone uses global.logError, btw)

The extension system does, but we could change that. I'm mostly just worried about extension compatibility.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-04-29 21:03:21 UTC
(In reply to comment #4)
> Review of attachment 213063 [details] [review]:
> 
> ::: js/ui/environment.js
> @@ +44,3 @@
> +function _makeLoggingFunc(func) {
> +    return function() {
> +        return func([].slice.apply(arguments).join(', '));
> 
> 1) You don't need [].slice.apply, use Array.prototype.join.call.
> 
> (Ok, it's difficult to tell which one is more readable, but at least it skips
> allocating the Array)

IIRC SpiderMonkey will compile this down into Array.prototype.slice.call anyway. I can just do the join directly, without the slice.

> 2) This is will regress logError, as that takes an exception as first argument,
> so it must not be coerced into a string.

Ah, whoops.

> @@ +56,3 @@
> +    window.logError = _makeLoggingFunc(window.logError);
> +    window.print = _makeLoggingFunc(window.print);
> +    window.printerr = _makeLoggingFunc(window.printerr);
> 
> Why print/printerr?
> They're not part of the legacy logging system.

Because they were there in context.c. I've seen some extensions using print, but I guess they won't need multiple arguments, and we should dissuade people from using them.

I guess all we'll need to patch is window.log, then.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-04-29 21:06:22 UTC
Created attachment 213066 [details] [review]
environment: Allow window.log and friends to take multiple arguments
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-04-29 21:06:25 UTC
Created attachment 213067 [details] [review]
lookingGlass: Remove the "Errors" tab

We already have one too many logging systems. Remove the errors tab
and make global.log/global.logError point to window.log/window.logError
instead.
Comment 10 Giovanni Campagna 2012-04-29 21:09:59 UTC
Review of attachment 213066 [details] [review]:

Good to commit, but remove "and friends" from the message.
Comment 11 Giovanni Campagna 2012-04-29 21:10:43 UTC
Review of attachment 213067 [details] [review]:

Good to go!
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-04-29 21:12:38 UTC
Comment on attachment 213067 [details] [review]
lookingGlass: Remove the "Errors" tab

Attachment 213067 [details] pushed as 78e894c - lookingGlass: Remove the "Errors" tab