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.

Can i choose a namespace color?

See original GitHub issue
error = require('debug')('app:error');

Can i make error to be exclusively red?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

TooTallNatecommented, Mar 7, 2017

Selecting the color itself is a bit wonky since you have to know the index in the array of the color that you want, but basically just set the debugInstance.color property of the instance to one of the values in the debug.colors Array. So for red you want index 5:

const createDebug = require('debug')
const error = createDebug('error')
error.color = createDebug.colors[5]


screen shot 2017-03-07 at 8 41 50 am

Yalhucommented, Apr 13, 2018

@TooTallNate All the debug’s output is console.log), including error var error=debug('debug:error').It is just a different color of namespace, not a real console.error. What’s more ,its color isn’t red.

How should I output a debug different infomation of info/log/warn/error, which I can filter on chrome console. wheather they are on a same color. Or same background color, different text color to distinguish info/log/warn/error. May be same feature with #514

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can i choose a namespace color? · Issue #432 · debug-js/debug
It is just a different color of namespace, not a real console.error . What's more ,its color isn't red. How should I output...
Read more >
Creating namespaces for named colors in Xcode - Peter Ringset
Our color names will now be main/green , main/purple , and main/red , which means that we can have multiple colors named red...
Read more >
Visual Studio doesn't color out namespaces like it used to, is ...
You can go to "Tools->Options->Environment->Fonts and Colors" and see if "C++ Namespaces" is set to something other than the default.
Read more >
Supporting multitenancy with isolated namespaces
Support multitenancy in Amazon QuickSight by implementing namespaces to isolate sets of groups and users.
Read more >
What do you name color variables? | CSS-Tricks
It's a simple approach, but proxying implementation colors to our defined colors means we can change the implementation without breaking or ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found