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

Community Feedback #1

Open
LukasKalbertodt opened this issue Jul 30, 2020 · 9 comments
Open

Community Feedback #1

LukasKalbertodt opened this issue Jul 30, 2020 · 9 comments

Comments

@LukasKalbertodt
Copy link
Owner

LukasKalbertodt commented Jul 30, 2020

Do you have any opinions, complaints, suggestions, ideas, ... about this library or its syntax? Let me know :)

@luciusmagn
Copy link

I like, it slaps, I use it to color stuff in my Gopher client that I'm currently working on. Haven't tried on Windows, but Linux experience is neat.

@LukasKalbertodt LukasKalbertodt pinned this issue Sep 5, 2020
@Berrysoft
Copy link

Could the color and other styles be specified by argument? For example,

bunt::println!("{$*}error:{/$}", Color::Red, ty);

In that case I could calculate the color at runtime.

@LukasKalbertodt
Copy link
Owner Author

@Berrysoft That's an interesting idea! I opened #21. Not sure if I can start working on it anytime soon, though.

@mirryi
Copy link

mirryi commented Aug 13, 2021

Thanks for the great library!

I'm using your library for one of my projects, but I wanted leveled logging. So I cobbled together this crate, which provides some convenience macros (error!, info!, debug!, etc.) over bunt::writeln!.

Not really sure if this functionality is appropriate to make a PR for, since it's not a proper log implementation and the level/output target configuration uses a global. But it's convenient, for what it's worth. Hopefully someone else looking for something similar might find it useful.

@LukasKalbertodt
Copy link
Owner Author

@Dophin2009 Thanks for letting me know. I think this functionality should certainly live outside of bunt itself, but as a standalone crate, it's great!

@eugenesvk
Copy link

Custom 1-letter aliases would be nice.

If you're only using a couple of color to highlight, it's less noisy and easy to remember

let ty = "u32";
bunt::println!("{$bir}error:{/$} invalid value for type `{[blue]}`", ty);

where each letter is an alias: bold, italic, red

@eugenesvk
Copy link

Another way to reduce noise to a minimum is to use "set on/off" logic instead of spans, so you wouldn't need to add closing tags {/$}, only colors that would remain active until the next change. Worst case you'd need to have as many tags, but instead of closing ones you'd have a new "default color" like {$d}
But best case is reducing the number of tags by 50%

@eugenesvk
Copy link

And another noise reduction act could that would work only for single colors: replace {$} with a single special Unicode symbol that would only parse 1 next symbol as a color

@eugenesvk
Copy link

And similar to supporting custom abbreviations you could have custom meaning of colors so that {$red} is not 255,0,0, but something more muted without having to specify that chose custom color by hex every time

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

No branches or pull requests

5 participants