Skip to content

how to avoid the tedious initialization? #154

Description

@stablum

also posted here: http://stackoverflow.com/questions/26777433/node-js-debug-module-how-to-avoid-this-tedious-initialization

I am wondering if there is any way to prevent this tedious and overly redundant inizialization in each module:

require('debug').enable('module-name:log module-name:ERROR');
var log = require('debug')('module-name:log');
var error = require('debug')('module-name:ERROR');

As you can see it's redundant on two different levels: I need to "enable" the loggers before instantiating them, sending the same name twice as strings, and I need to write the module name. Is there any way to do this automagically?

Activity

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

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