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
Proposal: colors and styles #83
Comments
So what I think would be in scope is some kind of filter for control sequences at least.
That said, I would definitely consider having a tight integration with a crate like that in simplelog. I am just not sure, if I want to maintain all that parsing code myself. |
I see, thank you for fast answer. Because this is not a issue "per se" so I am closing it for now... will reopen when necessary. |
Just for future reference... use paris::formatter::colorize_string;
//standard simplelog initialize
let t = colorize_string("<blue><on-bright-red> This text is blue on a bright red background</> it's a pain");
info!("{}", t);
//or:
warn!("{}", colorize_string("<b><green>test string")); I will now search how can I wrap it in some macro (proxy as you mention) to be able to use it like before using just |
If you manage to do that, I would accept those macros (assuming they would be rather simple) in simplelog behind a (by default disabled) optional |
Great, added a PR #84. |
Hi!
I really like use your simplelog as my main logger for projects :)
I am now experimenting with adding support for bold/italic and colors in my log messages.
I am not aware of this with the simplelog (correct me if I am wrong), so I am using an ansi_term crate for this.
The downsides of this approach:
Style::new().bold().fg(Green).paint(err.to_string())
I want to ask what is your opinion to have in simplelog something similar as in paris, ie parser for the following:
log.info("<blue><on-bright-red> This text is blue on a bright red background</> it's a pain");
I am not sure if the above parsing is even possible when using error!, info! macros from rust...?
Is it in a scope of this project?
The text was updated successfully, but these errors were encountered: