esp-rs / esp-flasher-stub

Rust implementation of flasher stub located in esptool
Apache License 2.0
17 stars 10 forks source link

Replace `dprint` module with `esp-println` and `log` crate #8

Closed JurajSadel closed 1 year ago

MabezDev commented 1 year ago

Maybe because esp-println uses UART0, it's better not to use esp-println here. Instead we can keep using the dprint module, but put it behind a feature, such that all the logs can be compiled in if the feature is enabled, or removed if the feature is disabled.

jessebraham commented 1 year ago

One option I've seen is to just #[cfg] away the body of the macro if the logging feature is not enabled, so that all the calls to dprintln!, etc. are still present in the code base but are ultimately expanded to nothing (which is basically what @MabezDev said :) ).