Log to System rather than Main
This fixes the issue where no log messages are produced by
compos_verify. Note that odsign already uses the System log, probably
for the same reason.
Bug: 215419883
Bug: 210919187
Test: Reboot after staged compile, see compos_verify logs
Change-Id: I86b0eda065c9154ae01a465aea7e724b746efa59
diff --git a/compos/verify/verify.rs b/compos/verify/verify.rs
index 55fe1bd..184b9ff 100644
--- a/compos/verify/verify.rs
+++ b/compos/verify/verify.rs
@@ -17,6 +17,7 @@
//! A tool to verify a CompOS signature. It starts a CompOS VM as part of this to retrieve the
//! public key. The tool is intended to be run by odsign during boot.
+use android_logger::LogId;
use anyhow::{bail, Context, Result};
use compos_aidl_interface::binder::ProcessState;
use compos_common::compos_client::{VmInstance, VmParameters};
@@ -39,7 +40,8 @@
android_logger::init_once(
android_logger::Config::default()
.with_tag("compos_verify")
- .with_min_level(log::Level::Info),
+ .with_min_level(log::Level::Info)
+ .with_log_id(LogId::System), // Needed to log successfully early in boot
);
// Redirect panic messages to logcat.