1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +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

@ -51,7 +51,7 @@ static bool allSupportedLocally(Store & store, const std::set<std::string>& requ
static int main_build_remote(int argc, char * * argv)
{
{
logger = makeJSONLogger(*logger);
logger = makeJSONLogger(STDERR_FILENO);
/* Ensure we don't get any SSH passphrase or host key popups. */
unsetenv("DISPLAY");