* 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.
This commit is contained in:
Eelco Dolstra 2003-08-29 13:12:30 +00:00
parent 25304af72e
commit 0d2bc68681

View file

@ -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);