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

Add builder struct or maybe integration with log crate #38

Closed
patrickelectric opened this issue Feb 19, 2021 · 3 comments
Closed

Add builder struct or maybe integration with log crate #38

patrickelectric opened this issue Feb 19, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@patrickelectric
Copy link

So, it would be nice to have something closer to the log create, or a kind of integration, where the user could set the message format, adding like: function/file name, line, time and etc.

@patrickelectric patrickelectric added the enhancement New feature or request label Feb 19, 2021
@0x20F
Copy link
Owner

0x20F commented Apr 29, 2021

Hi, and thanks for checking out the crate!
Sorry for the late answer...

See my reply in #40 regarding updates.

@0x20F 0x20F mentioned this issue Oct 25, 2021
@0x20F 0x20F closed this as completed Oct 25, 2021
@manio
Copy link
Contributor

manio commented Oct 25, 2021

Just tested this. Works like a charm :)

For the reference:

use paris::formatter::colorize_string;
//initialize your old logger here
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"));

This is so cool. So now instead of this (ansi_term):
Style::new().bold().fg(Green).paint(err.to_string())
I can use just <b><green>{}

I will now search if I could wrap it in some macro to be able to use it like before using just info!, warn!, etc

@0x20F
Copy link
Owner

0x20F commented Oct 25, 2021

@manio Hell yeah that's really clean. Glad it works nicely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants