Replace use of deprecated logging functions
This is needed to upgrade the android_logger crate from 0.12.0
to 0.13.3.
with_max_level provides the same functionality as with_min_level.
The renaming is admittedly confusing, but the new name is accurate
and it makes sense that they deprecated and then removed the
previously poorly named with_min_level.
See crate documentation [1] and code [2].
[1]: https://docs.rs/android_logger/0.12.0/android_logger/struct.Config.html#method.with_min_level
[2]: https://docs.rs/android_logger/0.12.0/src/android_logger/lib.rs.html#227
Bug: 322718401
Test: build and run CF with the change.
Test: m aosp_cf_x86_64_phone
Change-Id: I39532792c2efd8a20a25da23004bc335d6c8ad7f
diff --git a/virtualizationmanager/src/main.rs b/virtualizationmanager/src/main.rs
index f058547..01c74f5 100644
--- a/virtualizationmanager/src/main.rs
+++ b/virtualizationmanager/src/main.rs
@@ -27,7 +27,7 @@
use anyhow::{bail, Context, Result};
use binder::{BinderFeatures, ProcessState};
use lazy_static::lazy_static;
-use log::{info, Level};
+use log::{info, LevelFilter};
use rpcbinder::{FileDescriptorTransportMode, RpcServer};
use std::os::unix::io::{FromRawFd, OwnedFd, RawFd};
use clap::Parser;
@@ -107,8 +107,8 @@
android_logger::init_once(
android_logger::Config::default()
.with_tag(LOG_TAG)
- .with_min_level(Level::Info)
- .with_log_id(android_logger::LogId::System),
+ .with_max_level(LevelFilter::Info)
+ .with_log_buffer(android_logger::LogId::System),
);
check_vm_support().unwrap();