Re: OTP-24 and lager and line numbers

Roger Lipscombe <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAJgnQd9-6M1Uo12X04Knb2WnEtZmfo6o-XBNZ=W+9F5UK4OT-g@mail.gmail.com>
On Fri, 11 Jun 2021 at 13:00, Roger Lipscombe <[email protected]> wrote:
> I was hoping not to have to fork lager to deal with this.

I fixed it up in our (already existing) formatter (which wraps
lager_default_formatter):

format(Msg, _Config, Colors) ->
    Msg2 = patch_line_number(Msg),
    lager_default_formatter:format(Msg2, ...).

patch_line_number({lager_msg, Dest, Meta, Sev, DT, TS, M}) ->
    Meta2 = lists:map(
        fun({line, {L, _}}) -> {line, L};
            (Other) -> Other end,
        Meta),
    {lager_msg, Dest, Meta2, Sev, DT, TS, M}.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.