Skip to content

Commit 71f0ee2

Browse files
committed
Do not send the whole metadata across processes
1 parent 5d51a11 commit 71f0ee2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/phoenix_live_reload/channel.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ defmodule Phoenix.LiveReloader.Channel do
6363
{:noreply, socket}
6464
end
6565

66-
def handle_info({@logs, %{level: level, msg: msg, meta: meta}}, socket) do
66+
def handle_info({@logs, %{level: level, msg: msg, file: file, line: line}}, socket) do
6767
push(socket, "log", %{
6868
level: to_string(level),
6969
msg: msg,
70-
file: meta[:file],
71-
line: meta[:line]
70+
file: file,
71+
line: line
7272
})
7373

7474
{:noreply, socket}

lib/phoenix_live_reload/web_console_logger.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ defmodule Phoenix.LiveReloader.WebConsoleLogger do
2828
msg = IO.iodata_to_binary(iodata)
2929

3030
Registry.dispatch(@registry, :all, fn entries ->
31-
for {pid, prefix} <- entries,
32-
do: send(pid, {prefix, %{level: level, msg: msg, meta: meta}})
31+
event = %{level: level, msg: msg, file: meta[:file], line: meta[:line]}
32+
33+
for {pid, prefix} <- entries do
34+
send(pid, {prefix, event})
35+
end
3336
end)
3437
end
3538
end

0 commit comments

Comments
 (0)