aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-08-10 16:38:48 +0200
committerSiri Hansen <[email protected]>2018-08-13 12:45:01 +0200
commit8df53e8de0c323efd03c959bef801216952722f8 (patch)
tree5ed35ec650ca31e9f942d08b2d4dd1df04ba120a /lib/kernel/doc/src
parent8cb79ba4d3b665e06a39c3437d7227c831753945 (diff)
downloadotp-8df53e8de0c323efd03c959bef801216952722f8.tar.gz
otp-8df53e8de0c323efd03c959bef801216952722f8.tar.bz2
otp-8df53e8de0c323efd03c959bef801216952722f8.zip
[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.
Diffstat (limited to 'lib/kernel/doc/src')
-rw-r--r--lib/kernel/doc/src/logger_formatter.xml14
1 files changed, 10 insertions, 4 deletions
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 @@
</item>
<tag><c>single_line = boolean()</c></tag>
<item>
- <p>If set to <c>true</c>, all newlines in the message are
- replaced with <c>", "</c>, and white spaces following
- directly after newlines are removed. Notice that newlines
- added by the <c>template</c> parameter are not replaced.</p>
+ <p>If set to <c>true</c>, each log event is printed as a
+ single line. To achieve this, <c>logger_formatter</c>
+ sets the field width to <c>0</c> for all <c>~p</c>
+ and <c>~P</c> control sequences in the format a string
+ (see <seealso marker="stdlib:io#format-2">
+ <c>io:format/2</c></seealso>), and replaces all
+ newlines in the message with <c>", "</c>. White spaces
+ following directly after newlines are removed. Notice
+ that newlines added by the <c>template</c> parameter are
+ not replaced.</p>
<p>Defaults to <c>true</c>.</p>
</item>
<tag><marker id="template"/>