[erlang-questions] R21 logger mangles map messages

Mark Geib mark.geib.44@REDACTED
Fri Aug 10 21:27:29 CEST 2018


So the combination of single_line => true, and the ~0p format field gives me what I want.
Thanks.

> On Aug 10, 2018, at 3:07 AM, Siri Hansen <erlangsiri@REDACTED> wrote:
> 
> 
> 
> Den tor. 9. aug. 2018 kl. 16:42 skrev Mark Geib <mark.geib.44@REDACTED <mailto:mark.geib.44@REDACTED>>:
> Yes that removed the extra commas. Of course now the log messages are multi-line.
> 
> So to get a single line message for maps, without the commas, is the only approach to format the message with something like
> io_lib:print(MyBigMap,1,8192,-1) and then log the string?
> 
> Yes, or you could specify field with 0 with ~p to indicate infinite line length, e.g.
> 
> logger:notice("my map: ~0p",[MyMap])
> 
> (Using the value 0 here is new from OTP-21, see the description of control sequence 'p' in the ref.man for io:format.)
> 
> I do, however, see this a bug in logger. It needs to be a bit more sophisticated when ensuring single line - I'm looking into it.
> 
> Regards
> /siri

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180810/0b8b4b86/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 528 bytes
Desc: Message signed with OpenPGP
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180810/0b8b4b86/attachment.bin>


More information about the erlang-questions mailing list