Set Logger level to :info in prod
[akkoma] / lib / pleroma / application.ex
index 9d2f3f3205cf53771438f75663be60026eec0fde..f47cb0ce97e4f495c2300b74712e640b65f24823 100644 (file)
@@ -5,6 +5,7 @@
 defmodule Pleroma.Application do
   import Cachex.Spec
   use Application
+  require Logger
 
   @name Mix.Project.config()[:name]
   @version Mix.Project.config()[:version]
@@ -73,18 +74,17 @@ defmodule Pleroma.Application do
 
     if dir && File.exists?(dir) do
       dir
-      |> File.ls!()
-      |> Enum.map(&Path.join(dir, &1))
-      |> Kernel.ParallelCompiler.compile()
+      |> Pleroma.Utils.compile_dir()
       |> case do
         {:error, _errors, _warnings} ->
           raise "Invalid custom modules"
 
         {:ok, modules, _warnings} ->
-          Enum.each(modules, fn mod ->
-            name = mod |> Atom.to_string() |> String.trim_leading("Elixir.")
-            IO.puts("Custom module loaded: #{name}")
-          end)
+          if @env != :test do
+            Enum.each(modules, fn mod ->
+              Logger.info("Custom module loaded: #{inspect(mod)}")
+            end)
+          end
 
           :ok
       end