mirror of
https://github.com/NixOS/nix
synced 2025-06-30 19:57:59 +02:00
Logger::result(): Support logging arbitrary JSON objects
This commit is contained in:
parent
220000dc1a
commit
2a2af3f72f
4 changed files with 27 additions and 4 deletions
|
@ -279,6 +279,16 @@ struct JSONLogger : Logger {
|
|||
addFields(json, fields);
|
||||
write(json);
|
||||
}
|
||||
|
||||
void result(ActivityId act, ResultType type, const nlohmann::json & j) override
|
||||
{
|
||||
nlohmann::json json;
|
||||
json["action"] = "result";
|
||||
json["id"] = act;
|
||||
json["type"] = type;
|
||||
json["payload"] = j;
|
||||
write(json);
|
||||
}
|
||||
};
|
||||
|
||||
Logger * makeJSONLogger(Descriptor fd, bool includeNixPrefix)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue