-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logger: out of box color support for errors and warnings #11215
Comments
@snitin315 strange, can you try to use |
This is not how to use the webpack logger. Use |
we use logging before we run webpack and sometimes after, and when we do other actions that don't need webpack (like init/info/migrate/generate), so I think we can't use infrastructure logger. |
@snitin315 we need to search way how we can implement colors using built-in logger |
@sokra isn't it possible to have colors with runtime? |
@snitin315 Please check the code, it is easy |
The runtime logger is intended for in browser usage where the browser devtools take care of colors and filtering. It's not intended for usage in node.js, because you won't have the ability to filter. It probably makes sense to offer multiple different runtime loggers for web and node.js targets. A node.js logger could apply console colors and filter e. g. via env variable. webpack would alias the logger depending on target. As side effect you would be able to use the node.js runtime logger for your stuff too. |
@sokra makes sense, How should I go ahead in Implementing this feature? |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Bump |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
Feature request
Logger should support colors for errors and warnings out of the box.
What is the expected behavior?
if we log warning with logger.warn('warning') it should print the warning in yellow color. same for errors with red colors.
What is motivation or use case for adding/changing the behavior?
we have use color ourself like
logger.warn(chalk.yellow('warning'))
How should this be implemented in your opinion?
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: