Log stats to stderr
We shouldn't pollute stdout.
This commit is contained in:
		
							parent
							
								
									c4ba5f4be9
								
							
						
					
					
						commit
						0a2545f95c
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		|  | @ -26,8 +26,6 @@ | ||||||
| 
 | 
 | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| using std::cout; |  | ||||||
| 
 |  | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -1746,14 +1744,11 @@ void EvalState::printStats() | ||||||
|     GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes); |     GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes); | ||||||
| #endif | #endif | ||||||
|     if (showStats) { |     if (showStats) { | ||||||
|         printMsg(v, "evaluation statistics:"); |  | ||||||
|         auto outPath = getEnv("NIX_SHOW_STATS_PATH","-"); |         auto outPath = getEnv("NIX_SHOW_STATS_PATH","-"); | ||||||
|         std::fstream fs; |         std::fstream fs; | ||||||
|         if (outPath != "-") { |         if (outPath != "-") | ||||||
|             fs.open(outPath, std::fstream::out); |             fs.open(outPath, std::fstream::out); | ||||||
|             printMsg(v, format("  written to: %1%") % outPath); |         JSONObject topObj(outPath == "-" ? std::cerr : fs, true); | ||||||
|         } |  | ||||||
|         JSONObject topObj(outPath == "-" ? cout : fs, true); |  | ||||||
|         topObj.attr("cpuTime",cpuTime); |         topObj.attr("cpuTime",cpuTime); | ||||||
|         { |         { | ||||||
|             auto envs = topObj.object("envs"); |             auto envs = topObj.object("envs"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue