Skip to content

Commit

Permalink
Add required conditions for Logger's metadata to be print (#13777)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krapaince authored Aug 12, 2024
1 parent 02a1f07 commit db72cdd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/logger/lib/logger/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ defmodule Logger.Formatter do
to the current process. The user can configure the backend to choose
which metadata it wants to print and it will replace the `$metadata`
value.
> #### When is user metadata printed? {: .warning}
>
> User's metadata must meet one of the following conditions to be printed:
>
> * Be a string (`is_binary/1`)
> * Be a number (either `is_integer/1` or `is_float/1`)
> * Be a PID
> * Be an atom
> * Be a reference
> * Be a port
> * Implement the `String.Chars` protocol
>
> If none of the conditions above are `true`, the given metadata get
> discarded.
"""

@type date :: {1970..10000, 1..12, 1..31}
Expand Down

0 comments on commit db72cdd

Please sign in to comment.