I'm trying to create a custom json fmt::FormatEvent and need to get a timestamp string to serialize into the json.
Using the Json formatter as reference within the library, it usesWriter::new, witch is not usable externally.
Proposal
Either
1) Make Writer::new public (as suggested #2223)
2) Change the signature of FormatTime::format_time to use io::Write
2) Add a get_timestamp_string method to FormatTime
Feature Request
Crates
tracing-subscriber
Motivation
I'm trying to create a custom json
fmt::FormatEvent
and need to get a timestamp string to serialize into the json. Using theJson
formatter as reference within the library, it usesWriter::new
, witch is not usable externally.Proposal
Either 1) Make
Writer::new
public (as suggested #2223) 2) Change the signature ofFormatTime::format_time
to useio::Write
2) Add aget_timestamp_string
method toFormatTime
I'm happy to create a PR for this with whatever solution is the best fit for this project.