Skip to content

Fix alignment of info log #11629

Closed
Closed

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.

Activity

  1. josevalim commented on Feb 16, 2022

    @josevalim
    Member

    Good catch! We need to remove the $levelpad from the default configuration. :) And deprecate it!

  2. added this to the v1.14 milestone on Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions