1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

showTrace flag in loggers

This commit is contained in:
Ben Burdette 2020-06-29 10:20:51 -06:00
parent ef24a0835d
commit 8f81fae116
10 changed files with 60 additions and 20 deletions

View file

@ -303,7 +303,6 @@ int handleExceptions(const string & programName, std::function<void()> fun)
ReceiveInterrupts receiveInterrupts; // FIXME: need better place for this
ErrorInfo::programName = baseNameOf(programName);
ErrorInfo::showTrace = settings.showTrace;
string error = ANSI_RED "error:" ANSI_NORMAL " ";
try {
@ -324,6 +323,7 @@ int handleExceptions(const string & programName, std::function<void()> fun)
printError("Try '%1% --help' for more information.", programName);
return 1;
} catch (BaseError & e) {
logger->setShowTrace(settings.showTrace);
logError(e.info());
// TODO fix to detect non-empty trace here.
if (e.hasTrace() && !settings.showTrace)