Always log to logcat
After commit 611cc94626825840661ab20f84b3903c48331dec we always pass
the log_to_stderr flag when running compsvc. So we can remove the flag.
Switched to logcat so all logs end up in the same place.
Added one extra log line in composd so it's easy to tell we succeeded
without needing to see the VM logs.
Bug: 213891964
Test: atest ComposTestCase
Test: composd_cmd test-compile, check logs
Test: composd_cmd staged-apex-compile, check logs
Change-Id: I076d06a752dbf5f13abfe971b2f7aa80a67c9a20
diff --git a/compos/src/compsvc_main.rs b/compos/src/compsvc_main.rs
index ebb5514..16e3031 100644
--- a/compos/src/compsvc_main.rs
+++ b/compos/src/compsvc_main.rs
@@ -51,20 +51,13 @@
}
fn try_main() -> Result<()> {
- let args = clap::App::new("compsvc")
- .arg(clap::Arg::with_name("log_to_stderr").long("log_to_stderr"))
- .get_matches();
- if args.is_present("log_to_stderr") {
- env_logger::builder().filter_level(log::LevelFilter::Debug).init();
- } else {
- android_logger::init_once(
- android_logger::Config::default().with_tag("compsvc").with_min_level(log::Level::Debug),
- );
- // Redirect panic messages to logcat.
- panic::set_hook(Box::new(|panic_info| {
- log::error!("{}", panic_info);
- }));
- }
+ android_logger::init_once(
+ android_logger::Config::default().with_tag("compsvc").with_min_level(log::Level::Debug),
+ );
+ // Redirect panic messages to logcat.
+ panic::set_hook(Box::new(|panic_info| {
+ error!("{}", panic_info);
+ }));
let service = compsvc::new_binder()?.as_binder();
let vm_service = get_vm_service()?;