1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

JSONLogger: Log to a file descriptor instead of another Logger

Logging to another Logger was kind of nonsensical - it was really just
an easy way to get it to write its output to stderr, but that only
works if the underlying logger writes to stderr.

This change is needed to make it easy to log JSON output somewhere
else (like a file or socket).
This commit is contained in:
Eelco Dolstra 2025-02-17 14:59:07 +01:00
parent ca2e52690d
commit bc66a9bbcf
5 changed files with 10 additions and 9 deletions

View file

@ -2225,7 +2225,7 @@ void LocalDerivationGoal::runChild()
/* Execute the program. This should not return. */
if (drv->isBuiltin()) {
try {
logger = makeJSONLogger(*logger);
logger = makeJSONLogger(STDERR_FILENO);
std::map<std::string, Path> outputs;
for (auto & e : drv->outputs)