diff --git a/base/cvd/cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc b/base/cvd/cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc index 6324fab8806..e1d8e0adfd4 100644 --- a/base/cvd/cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc +++ b/base/cvd/cuttlefish/host/commands/assemble_cvd/assemble_cvd.cc @@ -190,9 +190,8 @@ Result> PreservingOnResume( "Restoring from snapshot requires not creating OS disks"); if (creating_os_disk) { // not snapshot restore, must be --resume - LOG(INFO) << "Requested resuming a previous session (the default behavior) " - << "but the base images have changed under the overlay, making " - << "the overlay incompatible. Wiping the overlay files."; + VLOG(0) << "Trying to resume previous session, but base images have " + "changed. Wiping overlay files."; if (InSandbox()) { return {{"launcher.log"}}; } else { @@ -429,7 +428,7 @@ Result InitFilesystemAndCreateConfig( auto environment = const_cast(config).ForDefaultEnvironment(); - LOG(INFO) << "Path for instance UDS: " << config.instances_uds_dir(); + VLOG(0) << "Path for instance UDS: " << config.instances_uds_dir(); for (const auto& instance : config.Instances()) { std::string vsock_dir = fmt::format("{}/vsock_{}_{}", TempDir(), diff --git a/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc b/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc index 31bed995094..150865aeeb9 100644 --- a/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc +++ b/base/cvd/cuttlefish/host/commands/assemble_cvd/graphics_flags.cc @@ -501,14 +501,14 @@ Result SelectGpuVhostUserMode(const GpuMode gpu_mode, gpu_vhost_user_mode_arg == kGpuVhostUserModeOff); if (gpu_vhost_user_mode_arg == kGpuVhostUserModeAuto) { if (gpu_mode == GpuMode::GuestSwiftshader) { - LOG(INFO) << "GPU vhost user auto mode: not needed for --gpu_mode=" - << GpuModeString(gpu_mode) << ". Not enabling vhost user gpu."; + VLOG(0) << "GPU vhost user auto mode: not needed for --gpu_mode=" + << GpuModeString(gpu_mode) << ". Not enabling vhost user gpu."; return false; } if (!VmManagerIsCrosvm(vmm)) { - LOG(INFO) << "GPU vhost user auto mode: not yet supported with " << vmm - << ". Not enabling vhost user gpu."; + VLOG(0) << "GPU vhost user auto mode: not yet supported with " << vmm + << ". Not enabling vhost user gpu."; return false; } @@ -517,13 +517,13 @@ Result SelectGpuVhostUserMode(const GpuMode gpu_mode, // in a separate process with a VMM prebuilt. See b/200592498. const auto host_arch = HostArch(); if (host_arch == Arch::Arm64) { - LOG(INFO) << "GPU vhost user auto mode: detected arm64 host. Enabling " - "vhost user gpu."; + VLOG(0) << "GPU vhost user auto mode: detected arm64 host. Enabling " + "vhost user gpu."; return true; } - LOG(INFO) << "GPU vhost user auto mode: not needed. Not enabling vhost " - "user gpu."; + VLOG(0) << "GPU vhost user auto mode: not needed. Not enabling vhost " + "user gpu."; return false; } diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp b/base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp index 2c039323ce3..aaaff9e725b 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/commands/start.cpp @@ -480,7 +480,7 @@ Result CvdStartCommandHandler::LaunchDevice( "information won't show in the UI: " << conn_res.error(); } - LOG(INFO) << "launch command: " << launch_command; + VLOG(0) << "launch command: " << launch_command; CF_EXPECT(subprocess_waiter_.Setup(launch_command)); diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc b/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc index 9b7d849fbeb..94a6b7fe2e9 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc +++ b/base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc @@ -193,9 +193,9 @@ Result DaemonizeLauncher(const CuttlefishConfig& config) { } if (!IsRestoring(config)) { if (exit_code == RunnerExitCodes::kSuccess) { - LOG(INFO) << kBootCompletedMessage; + VLOG(0) << kBootCompletedMessage; } else { - LOG(INFO) << kBootFailedMessage; + LOG(ERROR) << kBootFailedMessage; } } std::exit(exit_code); @@ -597,7 +597,6 @@ class CvdBootStateMachine : public SetupFeature, public KernelLogPipeConsumer { } if ((*read_result)->event == monitor::Event::BootCompleted) { - LOG(INFO) << "Virtual device booted successfully"; state_ |= kGuestBootCompleted; if (!instance_.vcpu_config_path().empty()) { auto res = WattsonRebalanceThreads(instance_.id()); diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/launch/kernel_log_monitor.cpp b/base/cvd/cuttlefish/host/commands/run_cvd/launch/kernel_log_monitor.cpp index 5613bc9b825..445a26af3ac 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/launch/kernel_log_monitor.cpp +++ b/base/cvd/cuttlefish/host/commands/run_cvd/launch/kernel_log_monitor.cpp @@ -31,7 +31,6 @@ #include "absl/log/check.h" #include "cuttlefish/common/libs/utils/subprocess.h" -#include "cuttlefish/host/commands/run_cvd/reporting.h" #include "cuttlefish/host/libs/config/config_instance_derived.h" #include "cuttlefish/host/libs/config/cuttlefish_config.h" #include "cuttlefish/host/libs/config/known_paths.h" @@ -47,17 +46,11 @@ namespace { class KernelLogMonitor : public CommandSource, public KernelLogPipeProvider, - public DiagnosticInformation, public LateInjected { public: INJECT(KernelLogMonitor(const CuttlefishConfig::InstanceSpecific& instance)) : instance_(instance) {} - // DiagnosticInformation - std::vector Diagnostics() const override { - return {"Kernel log: " + instance_.PerInstancePath("kernel.log")}; - } - Result LateInject(fruit::Injector<>& injector) override { number_of_event_pipes_ = injector.getMultibindings().size(); @@ -133,7 +126,6 @@ KernelLogMonitorComponent() { .bind() .addMultibinding() .addMultibinding() - .addMultibinding() .addMultibinding(); } diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.cpp b/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.cpp index 182db9d4338..06bd0b32c01 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.cpp +++ b/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.cpp @@ -27,10 +27,6 @@ namespace cuttlefish { -std::string LogcatInfo(const CuttlefishConfig::InstanceSpecific& instance) { - return "Logcat output: " + LogcatPath(instance); -} - Result LogcatReceiver( const CuttlefishConfig::InstanceSpecific& instance) { // Open the pipe here (from the launcher) to ensure the pipe is not deleted diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.h b/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.h index 249d7b52dd7..bf24f88e19b 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.h +++ b/base/cvd/cuttlefish/host/commands/run_cvd/launch/logcat_receiver.h @@ -23,8 +23,6 @@ namespace cuttlefish { -std::string LogcatInfo(const CuttlefishConfig::InstanceSpecific& instance); - Result LogcatReceiver( const CuttlefishConfig::InstanceSpecific& instance); diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/main.cc b/base/cvd/cuttlefish/host/commands/run_cvd/main.cc index bd36ac1dc79..5df0a97271d 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/main.cc +++ b/base/cvd/cuttlefish/host/commands/run_cvd/main.cc @@ -88,16 +88,11 @@ namespace { class CuttlefishEnvironment : public DiagnosticInformation { public: - INJECT( - CuttlefishEnvironment(const CuttlefishConfig::InstanceSpecific& instance)) - : instance_(instance) {} + INJECT(CuttlefishEnvironment()) {} // DiagnosticInformation std::vector Diagnostics() const override { - auto config_path = instance_.PerInstancePath("cuttlefish_config.json"); return { - "Launcher log: " + instance_.launcher_log_path(), - "Instance configuration: " + config_path, // TODO(rammuthiah) replace this with a more thorough cvd host package // version scheme. Currently this only reports the Build Number of // run_cvd and it is possible for other host binaries to be from @@ -107,7 +102,6 @@ class CuttlefishEnvironment : public DiagnosticInformation { } private: - const CuttlefishConfig::InstanceSpecific& instance_; }; class InstanceLifecycle : public LateInjected { @@ -196,7 +190,6 @@ fruit::Component<> runCvdComponent( .install(AutoCmd::Component) .install(AutoCmd::Component) .install(AutoCmd::Component) - .install(AutoDiagnostic::Component) .install(KernelLogMonitorComponent) .install(AutoCmd::Component) .install(OpenwrtControlServerComponent) diff --git a/base/cvd/cuttlefish/host/commands/run_cvd/reporting.cpp b/base/cvd/cuttlefish/host/commands/run_cvd/reporting.cpp index b64274456ca..a152e58d26e 100644 --- a/base/cvd/cuttlefish/host/commands/run_cvd/reporting.cpp +++ b/base/cvd/cuttlefish/host/commands/run_cvd/reporting.cpp @@ -29,8 +29,7 @@ DiagnosticInformation::~DiagnosticInformation() = default; void DiagnosticInformation::PrintAll( const std::vector& infos) { - LOG(INFO) << kGreenColor - << "The following lines contain useful debugging information:" + LOG(INFO) << kGreenColor << " Run `cvd logs` to report paths to device logs." << kResetColor; for (const auto& info : infos) { for (const auto& line : info->Diagnostics()) { diff --git a/base/cvd/cuttlefish/host/commands/start/validate_metrics_confirmation.cpp b/base/cvd/cuttlefish/host/commands/start/validate_metrics_confirmation.cpp index 2cf1af77007..31c2a850b35 100644 --- a/base/cvd/cuttlefish/host/commands/start/validate_metrics_confirmation.cpp +++ b/base/cvd/cuttlefish/host/commands/start/validate_metrics_confirmation.cpp @@ -38,40 +38,16 @@ std::string ValidateMetricsConfirmation(std::string use_metrics) { } } - std::cout << "===============================================================" - "====\n"; - std::cout << "NOTICE:\n\n"; - std::cout << "By using this Android Virtual Device, you agree to\n"; - std::cout << "Google Terms of Service (https://policies.google.com/terms).\n"; - std::cout - << "The Google Privacy Policy (https://policies.google.com/privacy)\n"; - std::cout - << "describes how Google handles information generated as you use\n"; - std::cout << "Google Services."; char ch = !use_metrics.empty() ? tolower(use_metrics.at(0)) : -1; if (ch != 'n') { if (use_metrics.empty()) { - std::cout << "\n=========================================================" - "==========\n"; - std::cout << "Automatically send diagnostic information to Google, such " - "as crash\n"; - std::cout << "reports and usage data from this Android Virtual Device. " - "You can\n"; - std::cout << "adjust this permission at any time by running\n"; - std::cout << "\"launch_cvd -report_anonymous_usage_stats=n\". (Y/n)?:"; + std::cout << "\nAutomatically send diagnostic information to Google from " + "this Android Virtual " + "Device. You can adjust this permission by running \"--report_anonymous_usage_stats=n\". (Y/n)?:"; } else { - std::cout << " You can adjust the permission for sending\n"; - std::cout << "diagnostic information to Google, such as crash reports " - "and usage\n"; - std::cout - << "data from this Android Virtual Device, at any time by running\n"; - std::cout << "\"launch_cvd -report_anonymous_usage_stats=n\"\n"; - std::cout << "===========================================================" - "========\n\n"; + std::cout << "You can adjust the permission for sending diagnostic " + "information to Google by running \"--report_anonymous_usage_stats=n\"\n"; } - } else { - std::cout << "\n===========================================================" - "========\n\n"; } for (;;) { switch (ch) { diff --git a/base/cvd/cuttlefish/host/libs/config/config_flag.cpp b/base/cvd/cuttlefish/host/libs/config/config_flag.cpp index 7f11f05126a..1bf9a3e5911 100644 --- a/base/cvd/cuttlefish/host/libs/config/config_flag.cpp +++ b/base/cvd/cuttlefish/host/libs/config/config_flag.cpp @@ -184,13 +184,12 @@ class ConfigFlagImpl : public ConfigFlag { return {}; } std::optional FindAndroidInfoConfig(size_t index) const { - std::string info_path = + const std::string info_path = system_image_dir_flag_.ForIndex(index) + "/android-info.txt"; - - LOG(INFO) << "Reading --config option from: " << info_path; if (!FileExists(info_path)) { return {}; } + VLOG(0) << "Reading --config option from: " << info_path; Result android_info_result = ReadFileContents(info_path); if (!android_info_result.ok()) { return {}; diff --git a/base/cvd/cuttlefish/host/libs/config/fetcher_config.cpp b/base/cvd/cuttlefish/host/libs/config/fetcher_config.cpp index b4625213a60..15680579d34 100644 --- a/base/cvd/cuttlefish/host/libs/config/fetcher_config.cpp +++ b/base/cvd/cuttlefish/host/libs/config/fetcher_config.cpp @@ -125,7 +125,7 @@ bool FetcherConfig::LoadFromFile(const std::string& file) { auto base_dir = android::base::Dirname(file); if (base_dir != "." && dictionary_.isMember(kCvdFiles)) { - LOG(INFO) << "Adjusting cvd_file paths to directory: " << base_dir; + VLOG(0) << "Adjusting cvd_file paths to directory: " << base_dir; for (const auto& member_name : dictionary_[kCvdFiles].getMemberNames()) { dictionary_[kCvdFiles][base_dir + "/" + member_name] = dictionary_[kCvdFiles][member_name];