Skip to content
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

Consider changing logging support to env_logger #45

Closed
volks73 opened this issue Apr 15, 2018 · 2 comments
Closed

Consider changing logging support to env_logger #45

volks73 opened this issue Apr 15, 2018 · 2 comments
Assignees

Comments

@volks73
Copy link
Owner

volks73 commented Apr 15, 2018

The loggerv crate uses the ansi_term crate for colorized output, so enabling ANSI escape sequences on Windows 10 is still needed to prevent preventing ANSI escape characters in the log messages. The ansi_term and atty crates dependencies still exist.

I believe the same verbosity-based logging functionality can be achieved with the env_logger crate, which uses the termcolor crate for coloring and would also add setting the log level from an environment variable.

It should be noted that the clap crate also uses the ansi_term crate for coloring but it handles the enabling of ANSI escape sequences for Windows 10 internally. Another alternative would be to add this internal functionality to the loggerv crate.

@volks73 volks73 self-assigned this Apr 15, 2018
@volks73
Copy link
Owner Author

volks73 commented Apr 15, 2018

It appears for clap v3, the project is moving away from ansi_term to termcolor as well.

@volks73
Copy link
Owner Author

volks73 commented Apr 15, 2018

I went ahead and did the conversion from loggerv to env_logger but was able to add a custom format that mimics the loggerv defaults and verbosity-based level selection. The requirements for enabling ANSI support on Windows 10 for the log messages has been removed.

Resolved as of ad4b008.

@volks73 volks73 closed this as completed Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant