Debug: Intended use of debug / How do you use debug

Created on 12 Jun 2014  路  1Comment  路  Source: visionmedia/debug

This is actually not an technical issue of debug.
I am using debug myself in all my projects (only server side at the moment), but i am wondering how you guys use debug in your projects and how is it intended to use by the creators?

Some questions:

  • Do you create different debug instances for different log levels / severities?
  • How do you create and maintain these different log levels? In a central module? global?
  • Do you mix debug with another logging module like winston or bunyan?
  • If so, why? If not, why?
  • "debug" for modules and libraries and other logging modules like winston or bunyan in your running apps?

Thanks
cheers

Most helpful comment

Do you create different debug instances for different log levels / severities?

Ya, sure, if that's what you want to do. I usually tend to just have 1 debug() instance per module though.

How do you create and maintain these different log levels? In a central module? global?

Just var debug = require('debug')('some-scope'); at the top of each module.

Do you mix debug with another logging module like winston or bunyan?

Nope.

If so, why? If not, why?

No because this is meant to be a debugging utility, not a logger.

"debug" for modules and libraries and other logging modules like winston or bunyan in your running apps?

I'm not really sure what you mean with that question...

Hope that helps. Cheers!

>All comments

Do you create different debug instances for different log levels / severities?

Ya, sure, if that's what you want to do. I usually tend to just have 1 debug() instance per module though.

How do you create and maintain these different log levels? In a central module? global?

Just var debug = require('debug')('some-scope'); at the top of each module.

Do you mix debug with another logging module like winston or bunyan?

Nope.

If so, why? If not, why?

No because this is meant to be a debugging utility, not a logger.

"debug" for modules and libraries and other logging modules like winston or bunyan in your running apps?

I'm not really sure what you mean with that question...

Hope that helps. Cheers!

Was this page helpful?
0 / 5 - 0 ratings