-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add required conditions for Logger's metadata to be print #13777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/logger/lib/logger/formatter.ex
Outdated
@@ -74,6 +74,18 @@ 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. | |||
|
|||
> #### Disclaimer {: .warning} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> #### Disclaimer {: .warning} | |
> #### When is user metadata printed? {: .warning} |
lib/logger/lib/logger/formatter.ex
Outdated
> * Be a string (match with the `is_binary/1` guard) | ||
> * Be a number (either match with the `is_integer/1` or `is_float/1` guard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> * Be a string (match with the `is_binary/1` guard) | |
> * Be a number (either match with the `is_integer/1` or `is_float/1` guard) | |
> * Be a string (`is_binary/1`) | |
> * Be a number (either `is_integer/1` or `is_float/1`) |
lib/logger/lib/logger/formatter.ex
Outdated
> User's metadata must meet one of the following conditions to be printed: | ||
> * Be a string (match with the `is_binary/1` guard) | ||
> * Be a number (either match with the `is_integer/1` or `is_float/1` guard) | ||
> * Be a pid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> * Be a pid | |
> * Be a PID |
lib/logger/lib/logger/formatter.ex
Outdated
> * Be a reference | ||
> * Be a port | ||
> * Implement the `String.Chars` protocol | ||
> otherwise the given metadata will be discarded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> otherwise the given metadata will be discarded. | |
> | |
> If none of the conditions above are true, the given metadata gets discarded. |
💚 💙 💜 💛 ❤️ |
Addresses #13772