-
Notifications
You must be signed in to change notification settings - Fork 5
Add tracing support #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add tracing support #114
Conversation
Tracing is a quite flexible crate, and you can almost effortlessly place the spans you want anywhere. What needs careful consideration next is how to customize the subscribers built specifically for particular tasks, and change the related trace level/span/target. And these subscribers should be placed outside of optd finally. We now need a standardized optd document template to explain how to use tracing as well as how to customize subscribers. By the way. Once the doc is clear, we can convert all existing debug statements that use printf or eprintf to tracing under corresponding filtering rules. |
Problem
Since optd is built on top of the asynchronous runtime tokio, traditional debugging (with print statements or gdb for example) is quite difficult. What most async Rust projects use instead is logging and tracing, specifically the tracing library.
Summary of changes
Added tracing support for the majority of functions that need to be traced. Placed a basic subscriber in optd_cli.