You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log4J has this nice feature that part of the log record is the number of millisecond since the logger initialization. It makes for a very simple timer giving you an idea of how long the process has run. Would it be possible to get it in env_logger?
The text was updated successfully, but these errors were encountered:
I suspect this could be implemented with a custom formatter (env_logger::Builder::format). Would you be willing to experiment with that to see what lessons could be learned in how well this works and generalizes?
We already have a custom formatter. But to obtain that result we would need to store in a OnceLock or similar the start, and accessing the OnceLock would add further contention.
Ok, sorry, we just found that we can do an Instant::now() and move the value inside the closure. So it's entirely doable. Maybe it would be interesting as an example.
Log4J has this nice feature that part of the log record is the number of millisecond since the logger initialization. It makes for a very simple timer giving you an idea of how long the process has run. Would it be possible to get it in
env_logger
?The text was updated successfully, but these errors were encountered: