mciantyre / teensy4-rs

Rust support for the Teensy 4
Apache License 2.0
271 stars 31 forks source link

Support optional logging in teensy4-panic #111

Closed mciantyre closed 2 years ago

mciantyre commented 2 years ago

The panic handler now has an optional log feature. If enabled, the default panic handler will log the panic message at the error level.

Try the new example to demonstrate the feature with the USB logger:

cargo run --example panic_log --target=thumbv7em-none-eabihf --release --all-features

An ISR-driven USB logger should be able to emits its log message. But, this might not be true if the panic happens within a critical section, or when the USB ISR is masked. There's a general caveat in the crate documentation, stating that users are responsible for making sure they can see the panic message.

mciantyre commented 2 years ago

bors r+

bors[bot] commented 2 years ago

Build succeeded: