aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-04-25 12:05:26 -0600
committerBen Burdette <bburdette@gmail.com>2020-04-25 12:05:26 -0600
commitd4fd7b543ee8dcea2a06c2f857b7e4dd72d34ccc (patch)
tree4d130c2f9e9f33898166c32f2376d05c56dc84bd /src/libutil/error.cc
parentcdac083dc54b65f66f88caf193c617c1dbf3bbd6 (diff)
print dashes instead of empty name string
Diffstat (limited to 'src/libutil/error.cc')
-rw-r--r--src/libutil/error.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index c800fe9a8..2c34325ac 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -148,14 +148,21 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
dashes.append("-");
// divider.
- out << fmt("%1%%2%" ANSI_BLUE " %3% %4% %5% %6%" ANSI_NORMAL,
- prefix,
- levelString,
- "---",
- einfo.name,
- dashes,
- einfo.programName.value_or(""))
- << std::endl;
+ if (einfo.name != "")
+ out << fmt("%1%%2%" ANSI_BLUE " --- %3% %4% %5%" ANSI_NORMAL,
+ prefix,
+ levelString,
+ einfo.name,
+ dashes,
+ einfo.programName.value_or(""))
+ << std::endl;
+ else
+ out << fmt("%1%%2%" ANSI_BLUE " -----%3% %4%" ANSI_NORMAL,
+ prefix,
+ levelString,
+ dashes,
+ einfo.programName.value_or(""))
+ << std::endl;
// filename.
if (einfo.nixCode.has_value()) {