daboross / fern

Simple, efficient logging for Rust
MIT License
848 stars 51 forks source link

Off the shelf formatters #82

Open piegamesde opened 3 years ago

piegamesde commented 3 years ago

When using out logging crates, having the possibility to set a custom log format is nice, but being required to do so every time is rather tedious. The current default for fern simply only prints the log message, which I wouldn't call a great default.

A possible solution for this could be to provide a few off the shelf working formatters in different flavors. These could be either constants or function (for parametrization). I think there should at least a simple formatter, one with time, and one with additional color (of course, feature gated).

daboross commented 3 years ago

Definitely agree with this!

See also #13, which is a similar concept that I never got around to really implementing.

piegamesde commented 3 years ago

I've added a prototype in #84