Only show errors in tasks

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-05-23 18:49:12 +02:00
parent 0720c255ca
commit 6cf6e47ec7
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -7,9 +7,15 @@ defmodule Mix.Tasks.Mobilizon.Common do
@moduledoc """
Common functions to be reused in mix tasks
"""
require Logger
def start_mobilizon do
if mix_task?(), do: Mix.Task.run("app.config")
unless System.get_env("DEBUG") do
Logger.configure(level: :error)
end
Application.put_env(:phoenix, :serve_endpoints, false, persistent: true)
{:ok, _} = Application.ensure_all_started(:mobilizon)