a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.62k stars 339 forks source link

Investigate logging libraries #262

Open dabreegster opened 4 years ago

dabreegster commented 4 years ago

abstutil::Timer could probably be partly replaced.

dabreegster commented 4 years ago

https://crates.io/crates/inferno https://crates.io/crates/flame https://crates.io/crates/tracing

dabreegster commented 3 years ago

Idea: Write two temporary log files, containing notes from info!, warn!, etc and the other with the Timer hierarchial progress bar. Use something like multitail to display both. This only makes sense for batch scripts like the importer.

Assuming we use a separate binary like multitail, import.sh can run the importer in the background and then launch multitail. This can be optional / autodetect multitail and fall back to the current behavior.

For redirecting logs to a file, many heavier-weight options, like

There can be a new constructor for Timer to optionally log to a file.

dabreegster commented 3 years ago

Related to importer management: https://github.com/Nukesor/pueue

dabreegster commented 2 years ago

The more I look at it, the more tracing seems like the ecosystem I'm looking for -- see https://crates.io/crates/tracing-timing for example. But in the short term, I need something like Timer in another project, so I'm going to try copying over and simplifying it there, and trying to integrate with indicatif a bit.