diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-05-29T20·42-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-05-29T20·42-0400 |
commit | 2c26985835cf82ed5d2979c3a400f72f6aeba32f (patch) | |
tree | 364273cc2613dab8ab578c7cb27e468dcfbe9f86 /src/libstore/build.cc | |
parent | 8058dab26e90db54708d4c698db843dd703ecbb2 (diff) |
Add option ‘build-keep-log’ to enable/disable writing of build logs
Fixes #26.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r-- | src/libstore/build.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 789a7f617c2c..985ea5e98e05 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2032,6 +2032,8 @@ string drvsLogDir = "drvs"; Path DerivationGoal::openLogFile() { + if (!queryBoolSetting("build-keep-log", true)) return ""; + /* Create a log file. */ Path dir = (format("%1%/%2%") % nixLogDir % drvsLogDir).str(); createDirs(dir); @@ -2071,7 +2073,8 @@ void DerivationGoal::handleChildOutput(int fd, const string & data) { if (verbosity >= buildVerbosity) writeToStderr((unsigned char *) data.data(), data.size()); - writeFull(fdLogFile, (unsigned char *) data.data(), data.size()); + if (fdLogFile != -1) + writeFull(fdLogFile, (unsigned char *) data.data(), data.size()); } if (hook && fd == hook->fromHook.readSide) |