Skip to content

Commit

Permalink
Let count_next count logs per level instead of total
Browse files Browse the repository at this point in the history
  • Loading branch information
mnishiguchi committed Nov 12, 2022
1 parent 14fb2fa commit 2f31df6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ring_logger/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,12 @@ defmodule RingLogger.Client do
end

def handle_call(:count_next, _from, state) do
count =
counts =
Server.get(state.index, 0)
|> Enum.count(&should_print?(&1, state))
|> Enum.filter(&should_print?(&1, state))
|> Enum.frequencies_by(&elem(&1, 0))

{:reply, count, state}
{:reply, counts, state}
end

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

0 comments on commit 2f31df6

Please sign in to comment.