-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add log-format argument #493
Conversation
Since the framing should mostly be compatible with the classic string streams, I'd probably suggest this to be opt out instead of opt in. It's probably much more annoying to enable defmt constantly for those who want it, than to disable for the few who have some custom binary in their logs. Transmission errors might shade this a bit for those who use noisy UART still, so I'm not sure. If you end up going down the opt-in road, maybe it wouldn't be the worst idea to future proof it a bit with |
To be honest, I don't have a preference if it should be opt-in or opt-out, any suggestion @esp-rs/espressif? |
As an idea, maybe we could enable printing location info with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with the --log-format
change we're ready to go. I much prefer this to have to build a whole different espflash, and we can support other formats in the future.
Just one comment about making serial the default :)
Co-authored-by: Dániel Buga <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -102,7 +108,16 @@ pub fn monitor_with<L: InputParser>( | |||
err => err, | |||
}?; | |||
|
|||
parser.feed(&buff[0..read_count], &mut stdout); | |||
match log_format { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why I didn't notice this but this isn't correct. The defmt parser is stateful, we can't just create a new one every time we have read some bytes.
Add-d/--defmt
flag formonitor
andflash
subcommands.Add
-f/--log-format
argument formonitor
andflash
subcommands.cc @bugadani since you added this feature
Draft until properly tested.Did some testing and seems to be working fine!We still need to figure out if we want opt-in or opt-out of defmt