Fix filtering documentation (#14705)
The filtering documentation implied that the msg attribute of the logger event map could be a binary, but according to the erlang types (https://www.erlang.org/doc/apps/kernel/logger.html#t:log_event/0) it can't be a binary. This change updates the docs with an example that comports with the actual typing.
This commit is contained in:
@@ -436,8 +436,9 @@ defmodule Logger do
|
||||
defmodule LogFilter do
|
||||
def filter(log_event, _opts) do
|
||||
case log_event do
|
||||
%{msg: msg} when is_binary(msg) ->
|
||||
if msg =~ "password" do
|
||||
%{msg: {:string, msg}} ->
|
||||
# msg may be a charlist or a binary
|
||||
if to_string(msg) =~ "password" do
|
||||
:stop
|
||||
else
|
||||
:ignore
|
||||
|
||||
Reference in New Issue
Block a user