emabee / flexi_logger

A flexible logger for rust programs that can write to stderr, stdout, and/or to log files
Apache License 2.0
315 stars 55 forks source link

`kv` support from log crate. Json formatter. #156

Closed sualehasif closed 8 months ago

sualehasif commented 8 months ago

It seems like the default formatter doesnt support structured keys and values. Is there an easy way to support that with flexi.

is there a community supported json formatter for outputs. Given the details and messiness of json, would prefer a well written community resource :)

emabee commented 8 months ago

Writing some format-function with the help of the json should not be too difficult, but maybe I underestimate the use-case. Would you provide some example log call and expected output?

emabee commented 8 months ago

With version 0.28 I added a feature kv and a feature 'json'. If you combine both you should have what you need.