diff --git a/lib/tower.ex b/lib/tower.ex index 287bada..8971543 100644 --- a/lib/tower.ex +++ b/lib/tower.ex @@ -218,8 +218,6 @@ defmodule Tower do alias Tower.Event - @default_reporters [Tower.EphemeralReporter] - @doc """ Determines if a process exit `reason` is "normal". @@ -450,7 +448,7 @@ defmodule Tower do end defp reporters do - Application.get_env(:tower, :reporters, @default_reporters) + Application.fetch_env!(:tower, :reporters) end defp async(fun) do diff --git a/lib/tower/logger_handler.ex b/lib/tower/logger_handler.ex index 57ac731..1edefce 100644 --- a/lib/tower/logger_handler.ex +++ b/lib/tower/logger_handler.ex @@ -1,7 +1,6 @@ defmodule Tower.LoggerHandler do @moduledoc false - @default_log_level :critical @handler_id Tower @own_logs_domain [:tower, :logger_handler] @@ -101,7 +100,7 @@ defmodule Tower.LoggerHandler do defp log_level do # This config env can be to any of the 8 levels in https://www.erlang.org/doc/apps/kernel/logger#t:level/0, # or special values :all and :none. - Application.get_env(:tower, :log_level, @default_log_level) + Application.fetch_env!(:tower, :log_level) end defp safe_log(level, message) do diff --git a/mix.exs b/mix.exs index fb6ec57..9b1795d 100644 --- a/mix.exs +++ b/mix.exs @@ -30,6 +30,10 @@ defmodule Tower.MixProject do def application do [ extra_applications: [:logger, :inets], + env: [ + reporters: [Tower.EphemeralReporter], + log_level: :critical + ], mod: {Tower.Application, []} ] end