mycelium icon indicating copy to clipboard operation
mycelium copied to clipboard

switch logging to tracing ecosystem

Open flokli opened this issue 1 month ago • 3 comments

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 the compact() default formatter, instead of prety_env_logger. Its CLI args are kept as-is. RUST_LOG env var still works, too.
  • The setup_the_logger function in the mobile crate is renamed to setup_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.

flokli avatar May 16 '24 19:05 flokli