aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-08-29 13:12:30 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-08-29 13:12:30 +0000
commit0d2bc686817306502b71f5ca2cd49cb1d501247c (patch)
tree3bef16b6f4aacc3fc078954a6f738b96ce1ad672 /src
parent25304af72ed5c8fd50aa1da01c5872567ebe6ba2 (diff)
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/exec.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/exec.cc b/src/exec.cc
index d4ee88f8a..e9ddb5ee1 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);