Skip to content

Commit 23d310b

Browse files
authored
chore: polishing. put basic usage info to stdout using one call to a void messing lines (#5019)
chore: polishing. put basic usage info to stdout using one call to avoid messing with lines
1 parent 70be62c commit 23d310b

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

src/server/dfly_main.cc

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// Copyright 2023, DragonflyDB authors. All rights reserved.
32
// See LICENSE for licensing terms.
43
//
@@ -649,30 +648,36 @@ void sigill_hdlr(int signo) {
649648
}
650649

651650
void PrintBasicUsageInfo() {
652-
std::cout << " .--::--. \n";
653-
std::cout << " :+*=: =@@@@@@@@= :+*+: \n";
654-
std::cout << " %@@@@@@%*=. =@@@@@@@@- .=*%@@@@@@# \n";
655-
std::cout << " @@@@@@@@@@@@#+-. .%@@@@#. .-+#@@@@@@@@@@@% \n";
656-
std::cout << " -@@@@@@@@@@@@@@@@*:#@@#:*@@@@@@@@@@@@@@@@- \n";
657-
std::cout << " :+*********####-%@%%@%-####********++. \n";
658-
std::cout << " .%@@@@@@@@@@@@@%:@@@@@@:@@@@@@@@@@@@@@% \n";
659-
std::cout << " .@@@@@@@@%*+-: =@@@@= .:-+*%@@@@@@@%. \n";
660-
std::cout << " =*+-: ###* .:-+*= \n";
661-
std::cout << " %@@% \n";
662-
std::cout << " *@@* \n";
663-
std::cout << " +@@= \n";
664-
std::cout << " :##: \n";
665-
std::cout << " :@@: \n";
666-
std::cout << " @@ \n";
667-
std::cout << " .. \n";
668-
std::cout << "* Logs will be written to the first available of the following paths:\n";
651+
std::string output =
652+
" .--::--. \n"
653+
" :+*=: =@@@@@@@@= :+*+: \n"
654+
" %@@@@@@%*=. =@@@@@@@@- .=*%@@@@@@# \n"
655+
" @@@@@@@@@@@@#+-. .%@@@@#. .-+#@@@@@@@@@@@% \n"
656+
" -@@@@@@@@@@@@@@@@*:#@@#:*@@@@@@@@@@@@@@@@- \n"
657+
" :+*********####-%@%%@%-####********++. \n"
658+
" .%@@@@@@@@@@@@@%:@@@@@@:@@@@@@@@@@@@@@% \n"
659+
" .@@@@@@@@%*+-: =@@@@= .:-+*%@@@@@@@%. \n"
660+
" =*+-: ###* .:-+*= \n"
661+
" %@@% \n"
662+
" *@@* \n"
663+
" +@@= \n"
664+
" :##: \n"
665+
" :@@: \n"
666+
" @@ \n"
667+
" .. \n"
668+
"* Logs will be written to the first available of the following paths:\n";
669+
669670
for (const auto& dir : google::GetLoggingDirectories()) {
670671
const string_view maybe_slash = absl::EndsWith(dir, "/") ? "" : "/";
671-
std::cout << dir << maybe_slash << "dragonfly.*\n";
672+
absl::StrAppend(&output, dir, maybe_slash, "dragonfly.*\n");
672673
}
673-
std::cout << "* For the available flags type dragonfly [--help | --helpfull]\n";
674-
std::cout << "* Documentation can be found at: https://www.dragonflydb.io/docs";
675-
std::cout << endl;
674+
675+
absl::StrAppend(&output,
676+
"* For the available flags type dragonfly [--help | --helpfull]\n"
677+
"* Documentation can be found at: https://www.dragonflydb.io/docs\n");
678+
679+
std::cout << output;
680+
std::cout.flush();
676681
}
677682

678683
void ParseFlagsFromEnv() {

0 commit comments

Comments
 (0)