Fix compatibility with Loggers in Elixir 1.15+

This commit is contained in:
Haelwenn (lanodan) Monnier 2023-12-24 10:45:29 +01:00 committed by Mark Felder
commit c389ea0f42
7 changed files with 44 additions and 18 deletions

View file

@ -385,7 +385,12 @@ defmodule Pleroma.ConfigDB do
@spec module_name?(String.t()) :: boolean()
def module_name?(string) do
Regex.match?(~r/^(Pleroma|Phoenix|Tesla|Ueberauth|Swoosh)\./, string) or
string in ["Oban", "Ueberauth", "ExSyslogger", "ConcurrentLimiter"]
if String.contains?(string, ".") do
[name | _] = String.split(string, ".", parts: 2)
name in ~w[Pleroma Phoenix Tesla Ueberauth Swoosh Logger LoggerBackends]
else
string in ~w[Oban Ueberauth ExSyslogger ConcurrentLimiter]
end
end
end