diff options
author | Alexander Bantyev <balsoft@balsoft.ru> | 2022-01-14 20:07:47 +0300 |
---|---|---|
committer | Alexander Bantyev <balsoft@balsoft.ru> | 2022-01-17 19:57:29 +0300 |
commit | 8cf54f754dcdd11ffb6ed4c7aa6794d113c849b3 (patch) | |
tree | bd38910d3e2e0c08438b8cd55bfa146e9d3eed15 | |
parent | 5e9653c3701eddf86312b534d7e8340c0857e84b (diff) |
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>
-rw-r--r-- | src/nix/main.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc index fe7469be4..5158c3902 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -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(); }); |