Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy a stack trace from the chrome console?

Suppose I get a stacktrace like this in the console:

enter image description here

How can I copy the stacktrace preserving the formatting?

When I copy this stacktrace I get one long line:

VM1130:2 Foobar not foundplayer.store.registerListener @ VM1130:2logErrorsInCallback @ magic_store:221registerListener @ magic_store:240registerListenerThis @ magic_store:246(anonymous function) @ VM1130:2InjectedScript._evaluateOn @ (program):878InjectedScript._evaluateAndWrap @ (program):811InjectedScript.evaluate @ (program):667

Is there a way to copy a stack trace in a more structured way?

like image 832
Michael_Scharf Avatar asked Apr 08 '16 15:04

Michael_Scharf


People also ask

How do you copy a stack trace?

Copy a stack trace to your clipboard:Click the paste as new tab but. Select a tab, make sure your cursor is not in the text editor, Paste your stack trace with Ctrl + V.


1 Answers

Copy-pasting seems to format OK now. Just copied this from an error:

Uncaught ReferenceError: osdlfm is not defined
    at <anonymous>:1:1
    at ad.js:12
    at new Promise (<anonymous>)
    at HTMLDocument.n (ad.js:12)

The stack trace that shows up after I expand the error formats OK, too:

(anonymous) @ VM183:1
(anonymous) @ ad.js:12
n @ ad.js:12

console stack trace

Version info:

  • Google Chrome: 63.0.3239.132 (Official Build) (64-bit)
  • Revision: 2e6edcfee630baa3775f37cb11796b1603a64360-refs/branch-heads/3239@{#709}
  • OS: Mac OS X
like image 181
Kayce Basques Avatar answered Oct 21 '22 07:10

Kayce Basques