Skip to content

Commit 43a4c85

Browse files
author
José Valim
committed
Don't discard Logger messages from other nodes
It is important to leave a trail of what executed in both systems.
1 parent 34ce5a5 commit 43a4c85

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/logger/lib/logger/backends/console.ex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ defmodule Logger.Backends.Console do
3434
{:ok, :ok, configure(options, state)}
3535
end
3636

37-
def handle_event({_level, gl, _event}, state) when node(gl) != node() do
38-
{:ok, state}
39-
end
40-
4137
def handle_event({level, _gl, {Logger, msg, ts, md}}, state) do
4238
%{level: log_level, ref: ref, buffer_size: buffer_size, max_buffer: max_buffer} = state
4339

lib/logger/lib/logger/config.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@ defmodule Logger.Config do
9696
# means this handler won't crash in case Logger
9797
# is not installed in the other node.
9898
:gen_event.notify({Logger, node(gl)}, event)
99-
{:ok, state}
99+
{:ok, update_counter(state, false)}
100100
end
101101

102102
def handle_event(_event, state) do
103-
state = update_counter(state, false)
104-
{:ok, state}
103+
{:ok, update_counter(state, false)}
105104
end
106105

107106
def handle_call({:configure, options}, state) do

0 commit comments

Comments
 (0)