Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support console.dir for pretty-printed object dumps when captureConsole=true #1763

Open
jakub-g opened this issue Dec 21, 2015 · 1 comment

Comments

@jakub-g
Copy link

jakub-g commented Dec 21, 2015

Sometimes when debugging I want to dump to console a pretty-printed object.

Normally in browser I'd use console.dir. In karma, this prints nothing, since dir is not listed here.
I can use console.dir but the output is an ugly non-readable one-liner.

So the scope of this issue would be to

  1. enable logging for console.dir when captureConsole is true
  2. enhance a stringifier to be whitespace-aware (behing the flag), and pass that flag to the stringifier when logging from console.dir.
  3. maybe also change the depth in case of console.dir to be more than 3.

Would you be interested in receiving a PR with those changes?

@jakub-g jakub-g changed the title Support console.dir for pretty-printed object dumps Support console.dir for pretty-printed object dumps when captureConsole=true Dec 21, 2015
@dignifiedquire
Copy link
Member

Hey, I'd be happy to accept a PR for this, better logging is always good to have :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants