From 3af5300c223190dc85af1789d368de6c74b2d622 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Tue, 21 Sep 2021 16:55:43 -0700 Subject: [PATCH] #1359: LB: add color to the output for easier reading --- .../balance/lb_invoke/lb_manager.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc index f10ab957da..a410100f06 100644 --- a/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc +++ b/src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc @@ -264,7 +264,15 @@ void LBManager::startLB(PhaseType phase, LBType lb) { /*static*/ void LBManager::printLBArgsHelp(LBType lb) { - fmt::print("\nLB arguments for {}:\n\n", lb_names_[lb]); + auto sep = fmt::format("{}{:-^120}{}\n", debug::bd_green(), "", debug::reset()); + fmt::print(sep); + fmt::print( + "{}{}LB arguments for {}{}{}:\n", + debug::vtPre(), debug::green(), debug::magenta(), + lb_names_[lb], debug::reset() + ); + fmt::print(sep); + fmt::print("\n"); std::unordered_map help; @@ -303,8 +311,11 @@ void LBManager::printLBArgsHelp(LBType lb) { if (help.size() > 0) { for (auto &arg_help : help) { - fmt::print("Argument: {}", arg_help.first); - fmt::print("{}\n", arg_help.second); + fmt::print( + "{}Argument: {}{}{}", + debug::yellow(), debug::red(), arg_help.first, debug::reset() + ); + fmt::print("{}{}{}\n", debug::reset(), arg_help.second, debug::reset()); } } else { fmt::print("No LB arguments are supported by this load balancer.\n\n"); @@ -321,7 +332,7 @@ void LBManager::printLBArgsHelp(std::string lb_name) { for (auto&& lb : vrt::collection::balance::lb_names_) { if (lb_name == lb.second) { vrt::collection::balance::LBManager::printLBArgsHelp(lb.first); - break; + break; } } }