tokio-rs / valuable

MIT License
185 stars 19 forks source link

Add a Display variant to Value. #85

Open chanks opened 2 years ago

chanks commented 2 years ago

Per discussion in Discord - @hawkw saw this as a desirable feature, to support emitting generic text in tracing without requiring that there be an underlying &str value.

Note that I used the Display output directly in the Debug impl for Value::Display - this seems a little awkward, but I'm not sure of a better option.

hawkw commented 2 years ago

I opened https://github.com/chanks/valuable/pull/1 to suggest a few potential changes to this PR. @chanks, please take a look and feel free to merge that branch into yours if you like! I would like to get this merged soon, if you have the time. Otherwise, I'm also happy to take it across the finish line, if you're busy.

chanks commented 2 years ago

Updated with your changes, thank you!

taiki-e commented 2 years ago

I think it would be preferable to compare this with the approach discussed in https://github.com/tokio-rs/valuable/issues/43 before merging. (having both is confusing.)

hawkw commented 2 years ago

This is going to be a blocker for fully replacing tracing's value system with valuable, so it would be nice to get this one figured out...