Function defmt_decoder::log::init_logger
source · [−]pub fn init_logger(
always_include_location: bool,
json: bool,
should_log: impl Fn(&Metadata<'_>) -> bool + Sync + Send + 'static
)Available on
unstable only.Expand description
Initializes a log sink that handles defmt frames.
Defmt frames will be printed to stdout, other logs to stderr.
The caller has to provide a should_log closure that determines whether a log record should be
printed.
If always_include_location is true, a second line containing location information will be
printed for all records, not just for defmt frames (defmt frames always get location info
included if it is available, regardless of this setting).