erlang/otp

Logger report `callback_mode` for `gen_statem` changed in OTP27

Opened this issue · 0 comments

Describe the bug

Since this change, the logger:report() emitted by when gen_statem crashes (when using callback_mode=handle_event_function) has a different value for the callback_mode key:

  • it used to be the handle_event_function atom in OTP 26-
  • it is now the module's fun Mod:handle_event/4

Not sure if this is a bug or intentional, feel free to close if it's the latter.
Just reporting in case it wasn't.

To Reproduce

(sorry in Elixir, taken from https://github.com/elixir-lang/elixir/pull/13684/files)

  defmodule MyGenStatemFormatStatus do
    @behaviour :gen_statem

    @impl true
    def callback_mode, do: :handle_event_function

    @impl true
    def init(state) do
      {:ok, :no_state, state}
    end

    @impl true
    def handle_event({:call, _}, :error, :no_state, _data) do
      raise "oops"
    end
  end

Expected behavior
Perhaps it should be consistent with OTP26- and return handle_event_function?

Affected versions

OTP 27.0