aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-04 15:11:53 +0200
committerKim Alvefur <zash@zash.se>2021-07-04 15:11:53 +0200
commit31eb61f22ab37174e239038e44c5d7b40519afec (patch)
treead516f0a39d0a49f727ac0b530218f2d809acae5
parentb93398ce799df5c165163c96e91d6a8205f0a83c (diff)
downloadprosody-31eb61f22ab37174e239038e44c5d7b40519afec.tar.gz
prosody-31eb61f22ab37174e239038e44c5d7b40519afec.zip
core.loggingmanager: Disable pretty printing when not connected to a tty
Things can behave unexpectedly when fed ANSI escape codes.
-rw-r--r--core/loggingmanager.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua
index e4ab32b5..d8e557f9 100644
--- a/core/loggingmanager.lua
+++ b/core/loggingmanager.lua
@@ -213,7 +213,7 @@ local function log_to_stdout(sink_config)
end
log_sink_types.stdout = log_to_stdout;
-local do_pretty_printing = true;
+local do_pretty_printing = not have_pposix or pposix.isatty(stdout);
local logstyles, pretty;
if do_pretty_printing then