Skip to content

Commit 23de9d8

Browse files
committed
Use the ansi_codes library in in run_cvd/reporting.cpp
Bug: b/528061247
1 parent fac16b9 commit 23de9d8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

base/cvd/cuttlefish/host/commands/run_cvd/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ cf_cc_library(
4646
srcs = ["reporting.cpp"],
4747
hdrs = ["reporting.h"],
4848
deps = [
49+
"//cuttlefish/ansi_codes",
4950
"//libbase",
5051
"@abseil-cpp//absl/log",
5152
"@fruit",

base/cvd/cuttlefish/host/commands/run_cvd/reporting.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,19 @@
2020

2121
#include "absl/log/log.h"
2222

23-
namespace cuttlefish {
23+
#include "cuttlefish/ansi_codes/ansi_codes.h"
2424

25-
static constexpr char kGreenColor[] = "\033[1;32m";
26-
static constexpr char kResetColor[] = "\033[0m";
25+
namespace cuttlefish {
2726

2827
DiagnosticInformation::~DiagnosticInformation() = default;
2928

3029
void DiagnosticInformation::PrintAll(
3130
const std::vector<DiagnosticInformation*>& infos) {
32-
LOG(INFO) << kGreenColor << " Run `cvd logs` to report paths to device logs."
33-
<< kResetColor;
31+
LOG(INFO) << kAnsiGreen << " Run `cvd logs` to report paths to device logs."
32+
<< kAnsiReset;
3433
for (const auto& info : infos) {
3534
for (const auto& line : info->Diagnostics()) {
36-
LOG(INFO) << kGreenColor << " " << line << kResetColor;
35+
LOG(INFO) << kAnsiGreen << " " << line << kAnsiReset;
3736
}
3837
}
3938
}

0 commit comments

Comments
 (0)