From 8df53e8de0c323efd03c959bef801216952722f8 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 10 Aug 2018 16:38:48 +0200 Subject: [logger] Avoid unwanted commas introduced by formatter's single_line option When printing a map with ~p in a log message, the formatter's single_line option in some cases introduced unwanted commas after '=>', for example: This is now corrected. When single_line==true, width 0 is added to all ~p and ~P control sequences in the format string. --- lib/kernel/doc/src/logger_formatter.xml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/logger_formatter.xml b/lib/kernel/doc/src/logger_formatter.xml index 9226d19834..5a060fd42b 100644 --- a/lib/kernel/doc/src/logger_formatter.xml +++ b/lib/kernel/doc/src/logger_formatter.xml @@ -130,10 +130,16 @@ single_line = boolean() -

If set to true, all newlines in the message are - replaced with ", ", and white spaces following - directly after newlines are removed. Notice that newlines - added by the template parameter are not replaced.

+

If set to true, each log event is printed as a + single line. To achieve this, logger_formatter + sets the field width to 0 for all ~p + and ~P control sequences in the format a string + (see + io:format/2), and replaces all + newlines in the message with ", ". White spaces + following directly after newlines are removed. Notice + that newlines added by the template parameter are + not replaced.

Defaults to true.

-- cgit v1.2.3