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.

[REQ] Log colouration

See original GitHub issue

Is your feature request related to a problem? Please describe.

Right now it’s hard to distinguish WARN/DEBUG/ERROR console messages in Macos Terminal. Most of time I ignore these messages, because it looks like INFO noise to me. When you generate the same build over and over again you just check error exit code or something red/yellow coloured in terminal output. If everything white or grey so it looks like nothing bad happened.

Describe the solution you’d like

I think it would be great to add an option of color output to all generators, like it works in maven or other significant libraries.

This line of code works in MacOs Terminal, but we need more global solution.

LOGGER.warn("\u001B[33m" + "Yellow message" + "\u001B[0m");

Describe alternatives you’ve considered

@Fjolnir-Dvorak suggested log-colouration pipelines. See quotes below.

Additional context

Quotes from Slack conversation:

@jimschubert says:

Another consideration is that we support creating custom standalone generators. Adding colors affects those. See, for example, Apache ServiceComb Toolkit.

@wing328 says:

As a workaround, what about simply grepping for WARN or ERROR in the output ?

@Fjolnir-Dvorak says:

For maven there are log-colouration pipelines. I think that would be the best for openapi-generator, too. If you want coloured output pipe it through a colourization pipe / shell script. That is in my opinion the most versatile and best solution. That could also be added to the wrapper script and could be enabled via a --colour (or the american --color 🇺🇸) flag

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ybelenkocommented, Nov 26, 2019

If you think this is useful feature and we need colors in console output, please add 👍 or any other emote to this message. It’s kind of a poll.

1reaction
wing328commented, Nov 27, 2019

We can include it in the project itself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express logging color format - node.js - Stack Overflow
Well You can customize your logger colors by making a custom logger try this //logger.js require('colors'); var _ = require('lodash'); var ...
Read more >
Making Logs Colorful in NodeJS - Medium
So basically Logs are one of the most required aspect of any server-side code ... “Got the packets” is now clearly visible in...
Read more >
tigercosmos/node-color-log: ⌨️ The more powerful ... - GitHub
node-color-log is a logger package for NodeJS and browsers. It provides more functions than the origin console.log . You can log text with...
Read more >
node-color-log - npm
node-color-log. TypeScript icon, indicating that this package has built-in type declarations. 10.0.2 • Public • Published 4 months ago.
Read more >
Using console colors with Node.js - LogRocket Blog
In this article, we'll learn how to implement console colors and how to use Chalk, Colors.js, and Color-CLI to help us. Issues with...
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