Elixir 1.19: Reword Logger backends deprecation warning
This commit is contained in:
parent
a4c929c527
commit
a4137243b6
2 changed files with 22 additions and 5 deletions
|
|
@ -420,10 +420,17 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
|||
@spec check_deprecated_logger_config() :: :ok | :error
|
||||
def check_deprecated_logger_config do
|
||||
if Application.get_env(:logger, :backends) do
|
||||
Logger.warning(
|
||||
"'config :logger, backends: [...]' is deprecated syntax due to changes in Elixir. " <>
|
||||
"Use 'config :pleroma, :logger, backends: [...]' instead."
|
||||
)
|
||||
Logger.warning("""
|
||||
!!!DEPRECATION WARNING!!!
|
||||
Your configuration is using deprecated syntax for configuring backends of Elixir's logger.
|
||||
`config :logger, backends: [...]` is deprecated syntax due to changes in Elixir.
|
||||
Please update your configuration at your earliest convenience to use:
|
||||
`config :pleroma, :logger, backends: [...]`
|
||||
Pleroma's default configuration will be updated in the next release which WILL override your settings.
|
||||
|
||||
Note: :console is no longer considered a backend and is used by default, you can disable it using:
|
||||
`config :logger, :default_handler: false`
|
||||
""")
|
||||
|
||||
:error
|
||||
else
|
||||
|
|
|
|||
|
|
@ -402,7 +402,17 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
|
|||
assert capture_log(fn ->
|
||||
Pleroma.Config.DeprecationWarnings.check_deprecated_logger_config()
|
||||
end) =~
|
||||
"'config :logger, backends: [...]' is deprecated syntax due to changes in Elixir. Use 'config :pleroma, :logger, backends: [...]' instead."
|
||||
"""
|
||||
!!!DEPRECATION WARNING!!!
|
||||
Your configuration is using deprecated syntax for configuring backends of Elixir's logger.
|
||||
`config :logger, backends: [...]` is deprecated syntax due to changes in Elixir.
|
||||
Please update your configuration at your earliest convenience to use:
|
||||
`config :pleroma, :logger, backends: [...]`
|
||||
Pleroma's default configuration will be updated in the next release which WILL override your settings.
|
||||
|
||||
Note: :console is no longer considered a backend and is used by default, you can disable it using:
|
||||
`config :logger, :default_handler: false`
|
||||
"""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue