lix/src
Maximilian Bosch 6ccfdb79c7
libutil/logging: extend internal-json logger to make it more machine-readable
The new error-format is pretty nice from a UX point-of-view, however
it's fairly hard to parse the output e.g. for editor plugins such as
vim-ale[1] that use `nix-instantiate --parse` to determine syntax errors in
Nix expression files.

This patch extends the `internal-json` logger by adding the fields
`line`, `column` and `file` to easily locate an error in a file and the
field `raw_msg` which contains the error-message itself without
code-lines and additional helpers.

An exemplary output may look like this:

```
[nix-shell]$ ./inst/bin/nix-instantiate ~/test.nix --log-format minimal
{"action":"msg","column":1,"file":"/home/ma27/test.nix","level":0,"line":4,"raw_msg":"syntax error, unexpected IF, expecting $end","msg":"<full error-msg with code-lines etc>"}
```

[1] https://github.com/dense-analysis/ale
2020-07-26 02:29:57 +02:00
..
build-remote Revert the enum struct change 2020-06-18 22:11:26 +00:00
cpptoml Revert the enum struct change 2020-06-18 22:11:26 +00:00
libexpr parseFlakeRef(): Only search for the top-level directory for CLI flakerefs 2020-07-17 14:54:21 +02:00
libfetchers Fix gitlab-fetcher to obtain tags and branches 2020-07-13 19:22:59 +02:00
libmain Merge remote-tracking branch 'origin/master' into flakes 2020-07-06 16:40:10 +02:00
libstore Merge pull request #3736 from obsidiansystems/allow-relative-paths-in-store-option 2020-07-21 19:43:07 +02:00
libutil libutil/logging: extend internal-json logger to make it more machine-readable 2020-07-26 02:29:57 +02:00
nix nix edit: call restoreSignals() before execvp-ing the $EDITOR 2020-07-17 17:35:59 +02:00
nix-build appended ' __attribute__((weak)); ' to 'extern char * * environ ' 2020-06-17 03:25:34 +01:00
nix-channel Merge branch 'master' into errors-phase-2 2020-05-11 14:35:30 -06:00
nix-collect-garbage Remove global -I flags 2020-03-30 15:30:19 +02:00
nix-copy-closure Revert the enum struct change 2020-06-18 22:11:26 +00:00
nix-daemon Remove trailing whitespace 2020-06-15 14:12:39 +02:00
nix-env Generations API cleanup 2020-07-16 15:18:21 +02:00
nix-instantiate remove 'format' from Error constructor calls 2020-04-21 17:07:07 -06:00
nix-prefetch-url Factor out commonality between nix-prefetch-url and nix-store --add-fixed 2020-07-10 13:21:37 +02:00
nix-store Remove 'accessor' from addToStore() 2020-07-13 18:31:19 +02:00
resolve-system-dependencies StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00