From 97c26c2af5ad9f02ec3ca8dfae2474fcdde2d439 Mon Sep 17 00:00:00 2001 From: Thalian Date: Sun, 15 Mar 2020 21:28:21 +0100 Subject: [PATCH] =?UTF-8?q?[DOCS]=20borgbackup#4073=20=E2=80=93=20Placehol?= =?UTF-8?q?derError=20not=20printed=20as=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport from master: Add a warning for --log-json option that parsing errors will always be printed as plain text. --- docs/internals/frontends.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/internals/frontends.rst b/docs/internals/frontends.rst index fb77eb48c..25db1b4df 100644 --- a/docs/internals/frontends.rst +++ b/docs/internals/frontends.rst @@ -36,6 +36,10 @@ Especially for graphical frontends it is important to be able to convey and refo in meaningful ways. The ``--log-json`` option turns the stderr stream of Borg into a stream of JSON lines, where each line is a JSON object. The *type* key of the object determines its other contents. +.. warning:: JSON logging requires successful argument parsing. Even with ``--log-json`` specified, a + parsing error will be printed in plain text, because logging set-up happens after all arguments are + parsed. + Since JSON can only encode text, any string representing a file system path may miss non-text parts. The following types are in use. Progress information is governed by the usual rules for progress information,