This PR is a bit of everything, but the overall goal is to make the code a little more readable and efficient π
It essentially does three things:
Adds the crates tracing and tracing-log: this enables us to replace all the manual logs we have in our methods with the #[tracing::instrument] macro, which will log the name of the function and the parameters it was called with. This makes the code much easier to read and uniform, and also makes the logs easier to read, as the function name and arguments are now logged on the same line and we get basically one line per function call.
Removes unnecessary logs: now that we have the above we no longer need to log all the messages we receive and send to the server, as we're already logging the parameters with which we call the functions anyways, so this will make the logs a lot easier to read as well.
Removes unnecessary clones: We had a lot of cases where we called serde_json::from_value(value.clone()) when really we could be calling T::deserialize(&value), which doesn't take ownership of value and achieves exactly the same.
This PR is a bit of everything, but the overall goal is to make the code a little more readable and efficient π It essentially does three things:
Adds the crates
tracing
andtracing-log
: this enables us to replace all the manual logs we have in our methods with the#[tracing::instrument]
macro, which will log the name of the function and the parameters it was called with. This makes the code much easier to read and uniform, and also makes the logs easier to read, as the function name and arguments are now logged on the same line and we get basically one line per function call.Removes unnecessary logs: now that we have the above we no longer need to log all the messages we receive and send to the server, as we're already logging the parameters with which we call the functions anyways, so this will make the logs a lot easier to read as well.
Removes unnecessary clones: We had a lot of cases where we called
serde_json::from_value(value.clone())
when really we could be callingT::deserialize(&value)
, which doesn't take ownership ofvalue
and achieves exactly the same.