about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-09-05T19·35+0200
committerEelco Dolstra <edolstra@gmail.com>2018-09-05T19·35+0200
commit0a2545f95c155588a82f0e112aa1e8853e58477d (patch)
tree4e1fb42d4a2d19b55833da2746924db692e306d7
parentc4ba5f4be9991f0d6700d29cd025d6fef1575e96 (diff)
Log stats to stderr
We shouldn't pollute stdout.
-rw-r--r--src/libexpr/eval.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index a67b7ae0dd60..08a2c2bfc6bc 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -26,8 +26,6 @@
 
 #endif
 
-using std::cout;
-
 namespace nix {
 
 
@@ -1746,14 +1744,11 @@ void EvalState::printStats()
     GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes);
 #endif
     if (showStats) {
-        printMsg(v, "evaluation statistics:");
         auto outPath = getEnv("NIX_SHOW_STATS_PATH","-");
         std::fstream fs;
-        if (outPath != "-") {
+        if (outPath != "-")
             fs.open(outPath, std::fstream::out);
-            printMsg(v, format("  written to: %1%") % outPath);
-        }
-        JSONObject topObj(outPath == "-" ? cout : fs, true);
+        JSONObject topObj(outPath == "-" ? std::cerr : fs, true);
         topObj.attr("cpuTime",cpuTime);
         {
             auto envs = topObj.object("envs");