mycelium
mycelium copied to clipboard
switch logging to tracing ecosystem
This switches:
- from android_logger to tracing-android
- from oslog to tracing-oslog
- from log to the default tracing log infrastructure
Most of the noise in here is changing the imports from log::{…}
to tracing::{…}
.
In terms of log setup, for now this tries to stick with the existing behaviour:
- myceliumd now uses
EnvFilter
and thecompact()
default formatter, instead ofprety_env_logger
. Its CLI args are kept as-is.RUST_LOG
env var still works, too. - The
setup_the_logger
function in themobile
crate is renamed tosetup_logging
.
I didn't change any of the actual log messages yet.
In a future PR, I'd like to make more use of the #[instrument]
macro to annoate some more fields, as well as enable OTLP (behind a feature flag).
Note I did not check building for IOS and Android for the mobile
crate.