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 654987 - main: add logStackTrace(), for debugging
main: add logStackTrace(), for debugging
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: 2011-07-20 17:49 UTC by Dan Winship
Modified: 2011-07-20 19:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: add logStackTrace(), for debugging (1.26 KB, patch)
2011-07-20 17:49 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2011-07-20 17:49:08 UTC
I do this a lot... I imagine other people must too?
Comment 1 Dan Winship 2011-07-20 17:49:10 UTC
Created attachment 192328 [details] [review]
main: add logStackTrace(), for debugging

Add Main.logStackTrace(), to print a (javascript) stack trace, which
is often useful when debugging.
Comment 2 Florian Müllner 2011-07-20 18:04:50 UTC
Review of attachment 192328 [details] [review]:

Yes, please!

::: js/ui/main.js
@@ +498,3 @@
+            log(msg + e.stack.substr(lf) + '\n');
+        else
+            log(e.stack.substr(lf + 1) + '\n');

Clever, but maybe more obvious when written as:

  if (msg)
      log(msg);
  let lf = e.stack.indexOf('\n');
  log(e.stack.substr(lf + 1) + '\n');
Comment 3 Dan Winship 2011-07-20 19:46:49 UTC
committed with less cleverness

Attachment 192328 [details] pushed as 4405d99 - main: add logStackTrace(), for debugging