From 0d2bc686817306502b71f5ca2cd49cb1d501247c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 29 Aug 2003 13:12:30 +0000 Subject: * Do not show the output of the builder unless the verbosity is at least at debug level (-vvv). The output is still appended to the build log in /nix/var/log/nix. --- src/exec.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/exec.cc') diff --git a/src/exec.cc b/src/exec.cc index d4ee88f8aaf6..e9ddb5ee14ca 100644 --- a/src/exec.cc +++ b/src/exec.cc @@ -43,8 +43,12 @@ void runProgram(const string & program, { /* Create a log file. */ string logFileName = nixLogDir + "/run.log"; + string logCommand = + verbosity >= lvlDebug + ? "tee -a " + logFileName + " >&2" + : "cat >> " + logFileName; /* !!! auto-pclose on exit */ - FILE * logFile = popen(("tee -a " + logFileName + " >&2").c_str(), "w"); /* !!! escaping */ + FILE * logFile = popen(logCommand.c_str(), "w"); /* !!! escaping */ if (!logFile) throw SysError(format("creating log file `%1%'") % logFileName); -- cgit 1.4.1