Skip to content

enable() invalidates created loggers that should be enabled #533

Closed
@turnerhayes

Description

@turnerhayes

For example, let's say I have the following:

const debug = require("debug");
const foobarDebug = debug("foo:bar");

debug.enable("foo:*");

console.log("debug.enabled('foo:bar')?", debug.enabled("foo:bar"));
console.log("foobarDebug enabled?", foobarDebug.enabled);

will output

debug.enabled('foo:bar')? true
foobarDebug enabled? false

If you create the debugger after calling enable() it works as expected. I understand that enable() overrides what was previously enabled, but I would expect that anything that passes the new filters would be enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue identifies a malfunctionhelp-wantedThis issue has an actionable item

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions