Migrating to Logger

Vance Shipley vances@REDACTED
Fri May 29 11:17:10 CEST 2020


Yeah,  I was just somewhat surprised there wasn't backward compatible
support. No biggy, if it's time to switch loggers it's time to reevaluate
all the reports anyway.

On Wed, May 27, 2020 at 6:10 PM Andreas Schultz <
andreas.schultz@REDACTED> wrote:

>
> Am Mi., 27. Mai 2020 um 10:52 Uhr schrieb Vance Shipley <
> vances@REDACTED>:
>
>> Is there a built in method to port this simple behaviour to the new
>> logger?
>>
>> 1> error_logger:info_report(["Something happened", {state, active}]).
>> ok
>> =INFO REPORT==== 27-May-2020::16:47:11.797398 ===
>>     "Something happened"
>>     state: active
>>
>
> The format of a report in logger differs from error_logger. Maybe
> something like this:
>
> $ erl
> Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:12:12] [ds:12:12:10]
> [async-threads:1]
>
> Eshell V11.0  (abort with ^G)
> 1> logger:set_primary_config(#{level => info}).
> ok
> 2> logger:info([{msg, "Something happened"}, {state, active}]).
> =INFO REPORT==== 27-May-2020::12:08:54.987946 ===
>     msg: Something happened
>     state: active
> ok
> 3> logger:info(#{msg => "Something happened", state => active}).
> =INFO REPORT==== 27-May-2020::12:09:10.560152 ===
>     msg: Something happened
>     state: active
> ok
> 4>
>
> Andreas
>
>
>> --
>>      -Vance
>>
>
>
> --
>
> Andreas Schultz
>


-- 
     -Vance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200529/d9395388/attachment.htm>


More information about the erlang-questions mailing list