Skip to content

Fix alignment of info log #11629

@nallwhy

Description

@nallwhy

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Elixir 1.13.2, Erlang/OTP 24
  • Operating system: mac

Current behavior

Only info log has two spaces between log_level and message.

require Logger

log_levels = [:debug, :info, :notice, :warning, :error, :critical, :alert, :emergency]

log_levels
|> Enum.each(&Logger.log(&1, "hi"))
21:08:12.477 [debug] hi

21:08:12.477 [info]  hi

21:08:12.477 [notice] hi

21:08:12.477 [warning] hi

21:08:12.477 [error] hi

21:08:12.477 [critical] hi

21:08:12.477 [alert] hi

21:08:12.477 [emergency] hi

I guess that is because of aligning logs when there was only debug, info, warn, error log levels exist, following the issue below.

#2610

Expected behavior

There is no reason to have two spaces in info log anymore.
warn became warning and other log levels longer than 5 chars were added. We can't align all of them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions