Show build and substitution information when not connected to a TTY

When stderr is not connected to a tty, show "building" and
"substituting" messages, a-la nix-build et al.

Closes https://github.com/NixOS/nix/issues/4402

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
This commit is contained in:
Alexander Bantyev 2022-01-14 20:07:47 +03:00
parent 5e9653c370
commit 8cf54f754d
No known key found for this signature in database
GPG key ID: E081FF12ADCB4AD5

View file

@ -270,11 +270,15 @@ void mainWrapped(int argc, char * * argv)
if (legacy) return legacy(argc, argv);
}
verbosity = lvlNotice;
settings.verboseBuild = false;
evalSettings.pureEval = true;
setLogFormat("bar");
settings.verboseBuild = false;
if (isatty(STDERR_FILENO)) {
verbosity = lvlNotice;
} else {
verbosity = lvlInfo;
}
Finally f([] { logger->stop(); });