From bbb3bcb1652a2fa837e5d9e49d36876f6d9e231e Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sun, 22 Aug 2021 00:26:22 +0300 Subject: Replace invalid characters in json logger Fixes #5159 Signed-off-by: Yaroslav Bolyukin --- src/libutil/logging.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 6b9b850ca..7d6090e0a 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -163,7 +163,7 @@ struct JSONLogger : Logger { void write(const nlohmann::json & json) { - prevLogger.log(lvlError, "@nix " + json.dump()); + prevLogger.log(lvlError, "@nix " + json.dump(-1, ' ', false, nlohmann::json::error_handler_t::replace)); } void log(Verbosity lvl, const FormatOrString & fs) override -- cgit v1.2.3