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/vm_payload/src/api.rs b/vm_payload/src/api.rs
index c76f2d3..7978059 100644
--- a/vm_payload/src/api.rs
+++ b/vm_payload/src/api.rs
@@ -24,7 +24,7 @@
Strong, ExceptionCode,
};
use lazy_static::lazy_static;
-use log::{error, info, Level};
+use log::{error, info, LevelFilter};
use rpcbinder::{RpcServer, RpcSession};
use openssl::{ec::EcKey, sha::sha256, ecdsa::EcdsaSig};
use std::convert::Infallible;
@@ -67,7 +67,7 @@
/// Make sure our logging goes to logcat. It is harmless to call this more than once.
fn initialize_logging() {
android_logger::init_once(
- android_logger::Config::default().with_tag("vm_payload").with_min_level(Level::Info),
+ android_logger::Config::default().with_tag("vm_payload").with_max_level(LevelFilter::Info),
);
}