mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 18:15:56 +08:00
Update log filter for miscapitalized module loading error (#2040)
This commit is contained in:
parent
2cd77aefeb
commit
ce5e91a20c
|
@ -18,17 +18,19 @@ defmodule Livebook.Runtime.ErlDist.LoggerGLHandler do
|
|||
end
|
||||
|
||||
@doc false
|
||||
def filter_code_server_logs(%{meta: meta} = event, _) do
|
||||
def filter_code_server_logs(%{msg: msg} = event, _) do
|
||||
# During intellisense we check if certain modules are loaded. If
|
||||
# the module name is miscapitalized, such as "Io", and we are on
|
||||
# a case insensitive file system, then :code_serverlogs an error
|
||||
# a case insensitive file system, this results in a log error
|
||||
# message: "Error loading module 'Elixir.Io'". We want to ignore
|
||||
# such logs
|
||||
|
||||
if Process.whereis(:code_server) == meta.pid do
|
||||
with {~c"~s~n", [content]} when is_list(content) <- msg,
|
||||
true <- :string.str(content, ~c"Error loading module") > 0,
|
||||
true <- :string.str(content, ~c"module name in object code is") > 0 do
|
||||
:stop
|
||||
else
|
||||
event
|
||||
_ -> event
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue