defmodule Mix.Pleroma do
@doc "Common functions to be reused in mix tasks"
- def start_pleroma do
+ def start_pleroma(change_logger_level \\ true) do
Application.put_env(:phoenix, :serve_endpoints, false, persistent: true)
- if Pleroma.Config.get(:env) != :test do
- Application.put_env(:logger, :console, level: :debug)
+ if Pleroma.Config.get(:env) != :test and change_logger_level do
+ require Logger
+ Logger.configure(level: :debug)
end
{:ok, _} = Application.ensure_all_started(:pleroma)
]
def run(["migrate_to_db"]) do
- start_pleroma()
+ # we want to save original logger level
+ start_pleroma(false)
if Pleroma.Config.get([:configurable_from_database]) do
Enum.each(@groups, &load_and_create(&1))
group
|> Application.get_all_env()
|> Enum.reject(fn {k, _v} ->
- k in [Pleroma.Repo, :env, :configurable_from_database] or
+ k in [Pleroma.Repo, Pleroma.Web.Endpoint, :env, :configurable_from_database] or
(group == :phoenix and k == :serve_endpoints)
end)
|> Enum.each(fn {key, value} ->