nix/doc/manual
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
..
advanced-topics Mention number of derivations to be build/fetched in output 2020-06-17 20:27:27 +08:00
command-ref libutil/logging: extend internal-json logger to make it more machine-readable 2020-07-26 02:29:57 +02:00
expressions Manpages: Do not refer to nixpkgs-channels 2020-05-23 15:26:59 +02:00
figures Fix corrupt PNG 2013-08-21 12:53:51 +02:00
glossary docs: Add IDs to important sections 2018-08-31 10:06:33 -04:00
installation docs/installer: add correct curl flags 2020-06-23 23:04:10 +01:00
introduction Instruct the user to follow redirects when installing Nix. 2020-06-18 10:29:24 +02:00
packages Add a link to official channels in the Channels chapter. 2020-01-09 14:15:19 -08:00
release-notes Fix typo 2020-05-09 13:48:31 +02:00
hacking.xml Update doc/manual/hacking.xml 2020-07-20 22:30:39 +01:00
local.mk Remove callout graphics 2020-03-13 16:32:43 +01:00
manual.xml Create upgrade notes 2018-09-01 15:35:46 -04:00
nix-lang-ref.xml * Various updates. 2009-11-05 09:07:43 +00:00
quote-literals.xsl Generate release notes again 2014-03-12 14:24:29 +01:00
schemas.xml * Document setuid Nix installs. 2004-10-31 17:08:48 +00:00