summaryrefslogtreecommitdiff
path: root/profcollectd
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2022-02-23 21:26:09 +0800
committerYi Kong <yikong@google.com>2022-02-23 13:27:52 +0000
commitd1cca10c23e9e5c43f79fb63e66524a12e7a3241 (patch)
treef63c882c733223a7d38fd0312fdb8b396b53b530 /profcollectd
parent8be7fb4133f02372a2e37de1a1535ee15648c91f (diff)
downloadextras-d1cca10c23e9e5c43f79fb63e66524a12e7a3241.tar.gz
profcollectd: Log to System rather than Main
This allows logging early in the boot sequence. Test: presubmit Bug: 215419883 Change-Id: I276c3becfbba00d39402d5bdd14492532eb95cf7
Diffstat (limited to 'profcollectd')
-rw-r--r--profcollectd/libprofcollectd/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/profcollectd/libprofcollectd/lib.rs b/profcollectd/libprofcollectd/lib.rs
index f95132f4..da178f27 100644
--- a/profcollectd/libprofcollectd/lib.rs
+++ b/profcollectd/libprofcollectd/lib.rs
@@ -127,6 +127,9 @@ pub fn reset() -> Result<()> {
pub fn init_logging() {
let min_log_level = if cfg!(feature = "test") { log::Level::Info } else { log::Level::Error };
android_logger::init_once(
- android_logger::Config::default().with_tag("profcollectd").with_min_level(min_log_level),
+ android_logger::Config::default()
+ .with_tag("profcollectd")
+ .with_min_level(min_log_level)
+ .with_log_id(android_logger::LogId::System),
);
}