exsync icon indicating copy to clipboard operation
exsync copied to clipboard

`:warning` Logger level not supported?

Open sardaukar opened this issue 7 months ago • 0 comments

I have Logger.warning calls in my code, and I see this on the first recompile triggered by ExSync:

[error] GenServer ExSync.Logger.Server terminating
** (FunctionClauseError) no function clause matching in ExSync.Logger.Server.color/1
    (exsync 0.3.0) lib/exsync/logger/server.ex:73: ExSync.Logger.Server.color(:warning)
    (exsync 0.3.0) lib/exsync/logger/server.ex:66: ExSync.Logger.Server.color_message/2
    (exsync 0.3.0) lib/exsync/logger/server.ex:56: ExSync.Logger.Server.maybe_log/3
    (exsync 0.3.0) lib/exsync/logger/server.ex:43: ExSync.Logger.Server.handle_call/3
    (stdlib 5.0.2) gen_server.erl:1113: :gen_server.try_handle_call/4
    (stdlib 5.0.2) gen_server.erl:1142: :gen_server.handle_msg/6
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.506.0>): {:log, :warning, ["compiling\n", "warning: <<REDACTED>>"]}
State: %ExSync.Logger.Server.State{group_leaders: MapSet.new([#PID<0.725.0>])}
Client #PID<0.506.0> is alive

The second time no longer errors. And I notice that if I add

defp color(:warning), do: :yellow

to exsync/lib/exsync/logger/server.ex the first recompile no longer shows the error.

I'm running Elixir 1.15.4 on Erlang 26.0.2

sardaukar avatar Dec 06 '23 22:12 sardaukar