Skip to content

Commit 2f31df6

Browse files
committed
Let count_next count logs per level instead of total
1 parent 14fb2fa commit 2f31df6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ring_logger/client.ex

+4-3
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@ defmodule RingLogger.Client do
235235
end
236236

237237
def handle_call(:count_next, _from, state) do
238-
count =
238+
counts =
239239
Server.get(state.index, 0)
240-
|> Enum.count(&should_print?(&1, state))
240+
|> Enum.filter(&should_print?(&1, state))
241+
|> Enum.frequencies_by(&elem(&1, 0))
241242

242-
{:reply, count, state}
243+
{:reply, counts, state}
243244
end
244245

245246
def handle_call({:tail, n}, _from, state) do

0 commit comments

Comments
 (0)