Merge "Replace use of deprecated logging functions" into main

This commit is contained in:
Treehugger Robot 2024-02-01 11:11:14 +00:00 committed by Gerrit Code Review
commit 2730678378
2 changed files with 6 additions and 4 deletions

View file

@ -40,8 +40,8 @@ fn main() {
android_logger::init_once(
android_logger::Config::default()
.with_tag("keystore2")
.with_min_level(log::Level::Debug)
.with_log_id(android_logger::LogId::System)
.with_max_level(log::LevelFilter::Debug)
.with_log_buffer(android_logger::LogId::System)
.format(|buf, record| {
writeln!(
buf,

View file

@ -31,7 +31,7 @@ use std::{
use anyhow::{ensure, Context, Result};
use clap::Parser;
use log::{error, info, Level};
use log::{error, info, LevelFilter};
use nix::sys::signal;
use tokio::{io::AsyncWriteExt, net::UnixListener as TokioUnixListener};
@ -48,7 +48,9 @@ struct Cli {
fn configure_logging() -> Result<()> {
ensure!(
logger::init(
logger::Config::default().with_tag_on_device("prng_seeder").with_min_level(Level::Info)
logger::Config::default()
.with_tag_on_device("prng_seeder")
.with_max_level(LevelFilter::Info)
),
"log configuration failed"
);