print dashes instead of empty name string

This commit is contained in:
Ben Burdette 2020-04-25 12:05:26 -06:00
parent cdac083dc5
commit d4fd7b543e

View file

@ -148,14 +148,21 @@ std::ostream& operator<<(std::ostream &out, const ErrorInfo &einfo)
dashes.append("-"); dashes.append("-");
// divider. // divider.
out << fmt("%1%%2%" ANSI_BLUE " %3% %4% %5% %6%" ANSI_NORMAL, if (einfo.name != "")
prefix, out << fmt("%1%%2%" ANSI_BLUE " --- %3% %4% %5%" ANSI_NORMAL,
levelString, prefix,
"---", levelString,
einfo.name, einfo.name,
dashes, dashes,
einfo.programName.value_or("")) einfo.programName.value_or(""))
<< std::endl; << std::endl;
else
out << fmt("%1%%2%" ANSI_BLUE " -----%3% %4%" ANSI_NORMAL,
prefix,
levelString,
dashes,
einfo.programName.value_or(""))
<< std::endl;
// filename. // filename.
if (einfo.nixCode.has_value()) { if (einfo.nixCode.has_value()) {