Erlang (OTP 21+) Logger Console Output Question (Garbled Prompt)

Brett Hemes brhemes@REDACTED
Fri May 7 21:21:34 CEST 2021


While developing I often use console prints as debugging/verification tools.  In the past I have used io:format for this purpose but I would like to use the new OTP logger to do this and then be able to filter based on severity and/or send them to a file instead of the console as the project matures.  However, I am having trouble currently preventing logger's output from destroying my console interactivity.  I have logger setup to use the console for output but **the logging prints output AT the current cursor position and thus destroy any input-in-progress** making interaction during busy logging near impossible.  In contrast, using io:format performs as desired where the output happens (and scrolls) right ABOVE the cursor line (i.e., without destroying the prompt).  Is this known behavior and/or is there any way to fix it (e.g., with some sys.config settings)?

For example,

With io:format:
    37> some_intput.
    some_info_i_would_like_to_display
    some_more_info
    info_etc
    38> my-next-input.<enter>
    39> <enter>
    39>

With logger:
    37> some_input.
    38> some_info_i_would_like_to_display
    my-nexsome_more_info
    t-input.<enter>

    39> info_etc<enter>

    39>



I would very much like to figure this out.

Thanks,
Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210507/7a19c74d/attachment.htm>


More information about the erlang-questions mailing list