embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.48k stars 765 forks source link

Change formatting of embassy-usb-logger #3294

Closed Kezii closed 1 month ago

Kezii commented 2 months ago

Am I missing something or is it impossible to change the style / formatting of the embassy-usb-logger? Ideally I should be able to override this default with my own style with log levels etc.

https://github.com/embassy-rs/embassy/blob/f0a86070512ad739641cee7d9fa39d63f5c8a9f6/embassy-usb-logger/src/lib.rs#L140

lulf commented 2 months ago

Yes, it's pretty basic, though you should be able to configure the log level.

Probably the way to go is to provide your own 'log' crate implementation, and perhaps expose whatever methods necessary on the usb-logger crate to do what you want.