diff options
Diffstat (limited to 'src/libmain')
-rw-r--r-- | src/libmain/loggers.cc | 2 | ||||
-rw-r--r-- | src/libmain/progress-bar.cc | 2 | ||||
-rw-r--r-- | src/libmain/shared.cc | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc index f62e9372c..0a7291780 100644 --- a/src/libmain/loggers.cc +++ b/src/libmain/loggers.cc @@ -27,7 +27,7 @@ Logger * makeDefaultLogger() { case LogFormat::rawWithLogs: return makeSimpleLogger(true); case LogFormat::internalJson: - return makeJSONLogger(*makeSimpleLogger()); + return makeJSONLogger(*makeSimpleLogger(true)); case LogFormat::bar: return makeProgressBar(); case LogFormat::barWithLogs: diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc index 95a9187de..3f7d99a1d 100644 --- a/src/libmain/progress-bar.cc +++ b/src/libmain/progress-bar.cc @@ -131,7 +131,7 @@ public: auto state(state_.lock()); std::stringstream oss; - oss << ei; + showErrorInfo(oss, ei, loggerSettings.showTrace.get()); log(*state, ei.level, oss.str()); } diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 1cb422967..52718c231 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -323,10 +323,8 @@ int handleExceptions(const string & programName, std::function<void()> fun) printError("Try '%1% --help' for more information.", programName); return 1; } catch (BaseError & e) { - if (settings.showTrace && e.prefix() != "") - printError(e.prefix()); logError(e.info()); - if (e.prefix() != "" && !settings.showTrace) + if (e.hasTrace() && !loggerSettings.showTrace.get()) printError("(use '--show-trace' to show detailed location information)"); return e.status; } catch (std::bad_alloc & e) { |