Skip to content

Improve logging when disconnecting serial #62

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukipuki
Copy link
Collaborator

Summary
An error that's propagated further shouldn't be logged using error! or warn!. The final consumer of the error can decide on the log message. The highest levels while the error is being propagated are trace! or debug!.

Related Issues
#27

Proposed Changes

  • lower the log level of some message

Checklist

  • Tests pass locally
  • Documentation updated if needed

An error that's propagated further shouldn't be logged using `error!` or
`warn!`. The final consumer of the error can decide on the log message.
The highest levels while the error is being propagated are `trace!` or
`debug!`.
@@ -58,7 +58,7 @@ where
let mut buffer = [0u8; 1024];
match read_stream.read(&mut buffer).await {
Ok(0) => {
warn!("read_stream has reached EOF");
trace!("read_stream has reached EOF");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose trace! here, as it exposes read_stream which is a variable name. Something that's not suitable for info or debug logs, only for trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant