Debug: Namespace conflicts

Created on 2 May 2017  路  7Comments  路  Source: visionmedia/debug

Namespaces would conflict and only the latest namespace would be activated at the same time.

Test case:

let debug = require('debug');

debug.enable('test1*');
debug.enable('test2*');

let log_1 = debug('test1');
let log_2 = debug('test2');

console.log(1, log_1.enabled);
console.log(2, log_2.enabled);

Results:

1 false
2 true

Expected:

1 true
2 true
bug change-minor discussion

Most helpful comment

@thebigredgeek This is probably another example of how we need to fix enable() / disable() for v3.

All 7 comments

@thebigredgeek This is probably another example of how we need to fix enable() / disable() for v3.

@TooTallNate yeah it might also make sense to merge namespaces by default, or throw an error (optional "strict" mode or something) if namespace collision occurs.

When do you think this will be released? I rely heavily on debug.enable('namespace:*') to enable debugging on a per-file basis.

@therealgilles We all have day jobs - as with the majority of open source, this will get fixed when it gets fixed.

@Qix- : My comment is from 7 months ago and was not meant to sound pushy. I totally understand, no worries. I have held off on upgrading thus far and the library still does the job for me. I also appreciate all the work people like you put in outside of their day jobs.

@qix-

See #425. I'm moving the discussion around .enable()/.disable() there.

Was this page helpful?
0 / 5 - 0 ratings