Struct android_logger::Config
source · pub struct Config { /* private fields */ }
Expand description
Filter for android logger.
Implementations§
source§impl Config
impl Config
sourcepub fn with_min_level(self, level: Level) -> Self
👎Deprecated: use .with_max_level()
instead
pub fn with_min_level(self, level: Level) -> Self
.with_max_level()
insteadDEPRECATED, use Config::with_max_level()
instead.
sourcepub fn with_max_level(self, level: LevelFilter) -> Self
pub fn with_max_level(self, level: LevelFilter) -> Self
Changes the maximum log level.
Note, that Trace
is the maximum level, because it provides the
maximum amount of detail in the emitted logs.
If Off
level is provided, then nothing is logged at all.
log::max_level()
is considered as the default level.
pub fn with_filter(self, filter: Filter) -> Self
pub fn with_tag<S: Into<Vec<u8>>>(self, tag: S) -> Self
sourcepub fn format<F>(self, format: F) -> Selfwhere
F: Fn(&mut dyn Write, &Record<'_>) -> Result + Sync + Send + 'static,
pub fn format<F>(self, format: F) -> Selfwhere
F: Fn(&mut dyn Write, &Record<'_>) -> Result + Sync + Send + 'static,
Sets the format function for formatting the log output.
android_logger::init_once(
Config::default()
.with_max_level(log::LevelFilter::Trace)
.format(|f, record| write!(f, "my_app: {}", record.args()))
)