Logging and error handling is currently in a not-so-ideal state as logs are not very detailed and sometimes the origin of an unexpected error is hard to find.
A couple of ideas to improve the situation:
- Use
tracing crate instead of log - log doesn't keep track of async context, tracing does with its spans (increases compile time and binary size and adds more dependencies)
- Find a way to consistently log unexpected errors in detail so they can be easily tracked down to their origin
- Combine detailed logging with error handling or separate them where necessary
- Do not just return a complex log message to a gRPC requester - find a way to return user friendly text, but still log details on the server side, especially on unexpected errors
- ...
Specific improvements:
Logging and error handling is currently in a not-so-ideal state as logs are not very detailed and sometimes the origin of an unexpected error is hard to find.
A couple of ideas to improve the situation:
tracingcrate instead oflog- log doesn't keep track of async context, tracing does with its spans (increases compile time and binary size and adds more dependencies)Specific improvements: