defmodule Pleroma.Application do
import Cachex.Spec
use Application
+ require Logger
@name Mix.Project.config()[:name]
@version Mix.Project.config()[:version]
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