1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 20:51:48 +02:00

Make the logger customisable

Add a new `--log-format` cli argument to change the format of the logs.
The possible values are
- raw (the default one for old-style commands)
- bar (the default one for new-style commands)
- bar-with-logs (equivalent to `--print-build-logs`)
- internal-json (the internal machine-readable json format)
This commit is contained in:
regnat 2020-06-05 17:01:02 +02:00
parent d558fb98f6
commit 170e86dff5
12 changed files with 107 additions and 13 deletions

View file

@ -1,5 +1,6 @@
#include "common-args.hh"
#include "globals.hh"
#include "loggers.hh"
namespace nix {
@ -38,6 +39,14 @@ MixCommonArgs::MixCommonArgs(const string & programName)
}},
});
addFlag({
.longName = "log-format",
.description = "Format of the logs. One of \"raw\", \"internal-json\", \"bar\" "
"or \"bar-with-logs\".",
.labels = {"format"},
.handler = {[](std::string format) { setLogFormat(format); }},
});
addFlag({
.longName = "max-jobs",
.shortName = 'j',