[Proposal] Translate error reports from gen_statem

41 views
Skip to first unread message

Cameron Duley

unread,
Mar 27, 2024, 11:10:26 AMMar 27
to elixir-lang-core
Several popular Elixir libraries use gen_statem internally, given it's very useful for managing data over persistent connections. However Elixir's default translations for Erlang log messages don't capture termination reports from gen_statem. As a result, gen_statem terminations leave no discernible errors for users.

It's really difficult for users unfamiliar with gen_statem to identify this issue, as they're unlikely to independently identify the problem and resolution, without help from someone already aware of this behavior.

The standing position is briefly discussed here, but I think it's worth reconsidering. It wouldn't take too much additional code to translate gen_statem exits, and it'd save lots of potential headache.

The current alternative solutions are to:
- Set "handle_sasl_reports: true" in logger's config (includes lots of extraneous stuff).
- Copy/paste this translator from Nostrum, credit to Johannes Christ.

As an aside, this issue actually came up on TJ DeVries' Twitch stream.

José Valim

unread,
Mar 27, 2024, 5:17:17 PMMar 27
to elixir-l...@googlegroups.com
I would love to see a PR that implements translation for gen_statem, so we can evaluate if it makes sense to merge it into Elixir.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/5382811a-535d-40c6-a262-08f7e380b7a5n%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages