Skip to content

Debug through logger's debug function #239

Closed
@bragma

Description

@bragma

Pardon me if this has already been answered. I know "debug" is not a logger and I respect that. I do not want to log with debug, I'd like debug to output in my logs instead. :-)
Specifically I'd like all third party modules using the ubiquitous "debug" to log through Winston's debug function. It's a matter of consistency turning log levels on/off dynamically.
Is it possible?

I've tried to leverage node's module caching in this way:

var Debug = require('debug');
var Logger = require('winston');
Debug.log = Logger.debug;

var mod = require('module_using_debug');

It's not working... :-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions