Conversation
|
Note that a user can still make this zero cost in the binary / at runtime by enabling the Do we need to defined policy around whether the security critical (hax compiled) parts may log? If critical parts don't log, that makes it easy on the safety/privacy aspects, because code outside that (even though being in the same crate) should probably not get access to secrets anyway. (We may want to vet debug impls for that though). If we log from critical code, is there a log level that is guaranteed not to contain key material? I'm unsure of the answer because while logged keys and secrets are useful during plug tests, they are a no-go in production systems. Not sure whether setting up cfg flags around it helps. |
Thanks for the heads up, added a way to set it from the application. As for the policy, yes that's important. As a first step, I was first looking into adding some sort of |
|
We can start with very basic logs just to "know where it went wrong", and build on top of it. Pushed a commit in that direction. Results look like this: |
|
This level of "entering this function now" is usually called "tracing", and there is <https://docs.rs/log/latest/log/macro.trace.html> for that.
AIU non-application crates should not meddle with log features. If you still think we need the new feature, maybe document as:
"This has a global effect of disabling all logging through the log crate. Only set this from the application crate; it is a shortcut through adding a dependency to log and disabling all logging there."
|
7856d02 to
249ee96
Compare
can be disabled in releases with a feature: `log/release_max_level_off` thus providing zero-cost for embedded deployments
|
@chrysn I changed the level to |
|
thanks, looks good!
|
Towards #280. Still couldn't get
defmt-or-logto work, but was able to have it working with justlog.Using
logadds about 1 KB of overhead when using the no_std example (cargo size --target='thumbv7em-none-eabihf' --no-default-features --features="crypto-cryptocell310, ead-authz, rtt" --release)This branch:
main: