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

How to get file:linenumber in debug() output? #198

Closed
MichaelJCole opened this issue Apr 19, 2015 · 6 comments
Closed

How to get file:linenumber in debug() output? #198

MichaelJCole opened this issue Apr 19, 2015 · 6 comments

Comments

@MichaelJCole
Copy link

Is this already implemented?

Thanks!

@karloluis
Copy link

Not that I know off. I believe that you can subtag your debugs though..

debug = require(debug)("SUPERTAG") 
debug("subtag")("Debug notes")

But I might be hallucinating.

@ghost
Copy link

ghost commented Aug 2, 2015

@MichaelJCole This is not possible now, but you can always console.trace() anywhere in your code.

@karloluis This is not possible either, unfortunately.

@jwebcat
Copy link

jwebcat commented Nov 18, 2015

A simple solution to this without modifying library code for Chrome, is to blackbox the debug.js script and you will still get the debugging message but you will get the line number of the js it got called from not the same line 444 from debug.js where log() is defined.

Here is a good readme on how to BlackBox scripts in chrome devTools

@ghost
Copy link

ghost commented Nov 18, 2015

@jwebcat Thanks! Very useful.

@jandrieu
Copy link

FWIW, (and as mentioned in issue #105 ) the blackboxing won't work for inline scripts such as created with browserify. There's an update in the works for blackboxing in Chromium, so maybe this will get fixed soon. https://code.google.com/p/chromium/issues/detail?id=563578

@Yalhu
Copy link

Yalhu commented Apr 13, 2018

@jwebcat Thanks! Very helpful.

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

No branches or pull requests

6 participants