flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
518 stars 34 forks source link

feature: Logging #47

Closed str4d closed 1 year ago

str4d commented 1 year ago

The Level and LevelFilter types are based on the equivalent tracing-core types. We then use them to implement wrapper macros around sys::furi_log_print_format.

str4d commented 1 year ago

Adding info!("Hello, reader of the logs!"); line to the hello-rust example app increases the size of hello-rust.fap from 908 bytes to 1080 bytes.

dcoles commented 1 year ago

@str4d I have a PR up that switches the print!/println! macros to ufmt. It results in a 76% smaller binary for the simple case of println!("Hello, {}", "Rust").

That seems to be enough of an improvement over core::fmt that it's probably worth using that rather than calling through to a printf-like function for formatting.

str4d commented 1 year ago

Rebased on main to fix merge conflicts.

str4d commented 1 year ago

Rebased on current main. I am not currently working on this (because it is blocked on #50, which in turn is blocked on #57), but I will rebase it for testing purposes when the main branch is updated to newer SDKs.

str4d commented 1 year ago

Rebased on aa1bfde5f3ce688c1f44c6945ea5863d03b5dac0 (the same base as #50).

str4d commented 1 year ago

Rebased on main and switched from the Flipper Zero SDK's printf to FuriString and ufmt instead.

str4d commented 1 year ago

Force-pushed because I forgot I'd renamed String to FuriString 😅