Skip to content

Conversation

@juanpabloaj
Copy link

Maybe modify the application section is not necessary.

I tried this package on elixir 1.14.0 without modify the application section and it works.

I followed this tutorial

https://dockyard.com/blog/2020/01/31/state-timeouts-with-gen_statem

More details:

https://www.amberbit.com/blog/2017/9/22/elixir-applications-vs-extra_applications-guide/

@lambdadog
Copy link

lambdadog commented Oct 16, 2024

The library certainly works without adding it as an application, but what the application does is register the translator.

defmodule GenStateMachine.Application do
@moduledoc false
use Application
@doc false
def start(_type, _args) do
Logger.add_translator({GenStateMachine.Translator, :translate})
Supervisor.start_link([], strategy: :one_for_one)
end
end

This is to make it so that GenStateMachine termination messages are properly logged, see https://elixirforum.com/t/why-does-logger-translator-ignore-gen-statem-reports/37418.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants