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

Easy way to turn it on from the file itself? #6

Open
tnrich opened this issue Oct 16, 2015 · 2 comments
Open

Easy way to turn it on from the file itself? #6

tnrich opened this issue Oct 16, 2015 · 2 comments

Comments

@tnrich
Copy link

tnrich commented Oct 16, 2015

Hey there, awesome little library you've got here.

I was wondering if you know of a way to easily enable logging from within a given file. For example,

var log = require('debug-logger')('RowView');
log.enable()

If it doesn't exist, would it be difficult to add this as a convenience?

Thanks!

@dmarcelino
Copy link
Member

Hi @tnrich,

Thanks.

As per debug-js/debug#169 (comment) you can do debug.enable(/*namespace*/);. So, something like the below should work:

var debugLogger  = require('debug-logger');
var log = debugLogger('RowView');
debugLogger.debug.enable('RowView');

Let us know the outcome.

@laggingreflex
Copy link
Contributor

It's debug.enable('RowView*') it seems (with an asterisk).

(also great library btw!)

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

No branches or pull requests

3 participants