Skip to content

Deprecate levelpad of Logger.Formatter - #11633

Merged
josevalim merged 4 commits into
elixir-lang:mainfrom
nallwhy:deprecate_levelpad
Feb 17, 2022
Merged

Deprecate levelpad of Logger.Formatter#11633
josevalim merged 4 commits into
elixir-lang:mainfrom
nallwhy:deprecate_levelpad

Conversation

@nallwhy

@nallwhy nallwhy commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR fixes #11629.

  • $levelpad is removed from @default_pattern of Logger.Formatter
  • Functions related to levelpad are annotated with @deprecated
@josevalim

Copy link
Copy Markdown
Member

Thank you for the PR @nallwhy!

Unfortunately the @deprecated attributes you added won't work as expected. You need to remove them. Instead, you need to add something here:

defp compile_code(key) when key in @valid_patterns, do: key

Something like:

  defp compile_code(:levelpad) do
    IO.warn "$levelpad in Logger message format is deprecated, please remove it"
    :levelpad
  end
@nallwhy
nallwhy force-pushed the deprecate_levelpad branch 2 times, most recently from eac33c3 to b1d5a60 Compare February 16, 2022 23:56
@josevalim
josevalim merged commit f20c017 into elixir-lang:main Feb 17, 2022
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants