From: Mark Felder Date: Wed, 20 Nov 2019 17:55:30 +0000 (-0600) Subject: Some tasks try to set log level in test environment, but we were stripping logs belog... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=edaae845afc63d558c22019b3b3f87bc510a3bdf;p=akkoma Some tasks try to set log level in test environment, but we were stripping logs belog :warn. Ensure console backend logs in test environment are :warn, but mix tasks run in test env do not run with :debug because it's far too verbose. --- diff --git a/config/test.exs b/config/test.exs index 07e70dd4d..9b737d4d7 100644 --- a/config/test.exs +++ b/config/test.exs @@ -15,7 +15,7 @@ config :pleroma, Pleroma.Captcha, method: Pleroma.Captcha.Mock # Print only warnings and errors during test -config :logger, +config :logger, :console, level: :warn, format: "\n[$level] $message\n" diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index 94eeb7d68..73a076a53 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -6,7 +6,11 @@ defmodule Mix.Pleroma do @doc "Common functions to be reused in mix tasks" def start_pleroma do Application.put_env(:phoenix, :serve_endpoints, false, persistent: true) - Application.put_env(:logger, :console, level: :debug) + + if Pleroma.Config.get(:env) != :test do + Application.put_env(:logger, :console, level: :debug) + end + {:ok, _} = Application.ensure_all_started(:pleroma) end