|
|
|
|
|
by nextaccountic
1483 days ago
|
|
libs like https://docs.rs/tracing/latest/tracing/ (for rust, but i'm sure most languages have things like it) can make logging work for async programs. it achieves it by structuring the log in nested spans, instead of just appending a timestamp and thus losing which async task is related to which log line. alongside with https://github.com/tokio-rs/console it makes log-based debugging for async programs a breeze (tokio-console shows which async tasks are running, like a top(1) but for async tasks, and can show logs of a given task) it's really fundamental to have good logging! both to discover issues as they unfold, and to debug past runs of the program for which you didn't know there was a problem and as such you didn't run the code in a debugger |
|
The approach you described is much more structured and absolutely vital.