Patterns for logging?

Any pattern I should stick to for debug logging in Rust?

Usually you would use the log crate for logging, or if async code, the tracing crate.

2 Likes

I'd say that, for nontrivial applications, tracing should be prefered over log these days. Hierarchical logging via spans is invaluable.

5 Likes

Thank you for the information, guys.

Good article

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.