alanj853
Application.stop/1 calls not being reported by :error_logger in Elixir 1.15.0
Hi,
I have noticed that Application.stop/1 calls are no longer being reported by erlang’s :error_logger in the same way with version 1.15.0. It was working with version 1.14.5.
See this sample module for an example. I use poison as the application to stop, but it could be any application that has started:
defmodule GenEventTester do
@moduledoc """
Documentation for `GenEventTester`.
"""
@behaviour :gen_event
require Logger
@impl :gen_event
def init(_) do
Logger.notice("init/1 has been called")
{:ok, %{}}
end
@impl :gen_event
def handle_event(msg, state) do
Logger.notice("handle_event/2 has been called: #{inspect(msg)}")
{:ok, state}
end
@impl :gen_event
def handle_call(msg, state) do
Logger.notice("handle_call/2 has been called: #{inspect(msg)}")
{:ok, :ok, state}
end
end
Running this with Elixir 1.14.5:
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
==> poison
Compiling 4 files (.ex)
Generated poison app
==> gen_event_tester
Compiling 1 file (.ex)
Generated gen_event_tester app
Interactive Elixir (1.14.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :error_logger.add_report_handler GenEventTester, []
09:08:57.338 [notice] init/1 has been called
:ok
iex(2)> Application.stop :poison
09:09:08.441 [notice] handle_event/2 has been called: {:info_report, #PID<0.70.0>, {#PID<0.44.0>, :std_info, [application: :poison, exited: :stopped, type: :temporary]}}
:ok
09:09:08.441 [notice] Application poison exited: :stopped
iex(3)>
Running this with Elixir 1.15.0:
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.15.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :error_logger.add_report_handler GenEventTester, []
09:10:53.747 [notice] init/1 has been called
:ok
iex(2)> Application.stop :poison
09:11:08.419 [notice] Application poison exited: :stopped
:ok
iex(3)>
Interestingly, the gen_event behaviour is being used somewhat, as the init/1 callback is called.
Does anybody know how to get the handle_event/2 callbacks to be called with Elixir 1.15.0, and/or know why this is happening?
Popular in Questions
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I'm writing a test for one of t...
New
Background
Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
I have a list say
x = ["23gh", "56kh", "97mh"]
I would like to pass each element to Val in each iteration.
Say, in iteration 1 -------...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir
iex(2)...
New
Other popular topics
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
I will often find my self writing things similar to:
case some_value do
nil -> something()
"" -> something()
_ -> someth...
New
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New







