question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multiple instances on the same namespace get different colors

See original GitHub issue

If I create multiple instances with the same namespace, they will each acquire a different color. This is very counter-intuitive to me; if I am creating multiple loggers on the same namespace then by definition I want them to be treated as a single unit. If I wanted them to be separate, I would if nothing else use different namespaces with a common prefix.

Example:

var debug = require('debug');
debug.enable('foo');

// shouldn't these use the same color?
var logger1 = debug('foo');
var logger2 = debug('foo');

I’m currently working around this in my app by wrapping debug with some code that caches the result by namespace, but it really seems like this functionality should be internal to debug.

I’m happy to submit a PR for this, if I get feedback that others agree this should be changed.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
thebigredgeekcommented, Dec 14, 2016

This should be fixed.

0reactions
lchenaycommented, Nov 28, 2016

+1 on this feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

multiple instances on the same namespace get different colors
If I create multiple instances with the same namespace, they will each acquire a different color. This is very counter-intuitive to me; ...
Read more >
c# - ambiguous class with namespace names in 2 dlls
Now I want to create an instance of one of them, but because the namespace and class names are same, the compiler goes...
Read more >
using directive - C# Reference - Microsoft Learn
A using directive doesn't give you access to any namespaces that are nested in the namespace you specify. Namespaces come in two categories: ......
Read more >
Modules and Namespaces in Jason1
This document describes how modules are used in Jason. Modules in Jason allow the programmer to develop agent programs into separate, independent, ...
Read more >
Use namespace rules in policy - Calico - Tigera
Use namespaces and namespace selectors in Calico network policy to group or ... A namespaceSelector matches one or more namespaces based on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found