-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove calls to error_logger #9469
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
Changes from all commits
1b9e2ea
c7bc277
2c7e23c
ee6eb37
6f4f33b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,22 +79,34 @@ defmodule Logger.Translator do | |
| {:ok, ["Application ", Atom.to_string(app), " exited: " | Application.format_error(reason)]} | ||
| end | ||
|
|
||
| def translate(_min_level, :error, :format, message) do | ||
| def translate( | ||
| _min_level, | ||
| :error, | ||
| :report, | ||
| {{Task.Supervisor, :terminating}, | ||
| %{ | ||
| name: name, | ||
| starter: starter, | ||
| function: function, | ||
| args: args, | ||
| reason: reason | ||
| }} | ||
| ) do | ||
| opts = Application.get_env(:logger, :translator_inspect_opts) | ||
|
|
||
| case message do | ||
| # TODO: Remove this once tasks are migrated to Logger | ||
| {'** Task ' ++ _, [name, starter, function, args, reason]} -> | ||
| {formatted, reason} = format_reason(reason) | ||
| metadata = [crash_reason: reason] ++ registered_name(name) | ||
| {formatted, reason} = format_reason(reason) | ||
| metadata = [crash_reason: reason] ++ registered_name(name) | ||
|
|
||
| msg = | ||
| ["Task #{inspect(name)} started from #{inspect(starter)} terminating"] ++ | ||
| [formatted, "\nFunction: #{inspect(function, opts)}"] ++ | ||
| ["\n Args: #{inspect(args, opts)}"] | ||
| msg = | ||
| ["Task #{inspect(name)} started from #{inspect(starter)} terminating"] ++ | ||
| [formatted, "\nFunction: #{inspect(function, opts)}"] ++ | ||
| ["\n Args: #{inspect(args, opts)}"] | ||
|
|
||
| {:ok, msg, metadata} | ||
| {:ok, msg, metadata} | ||
| end | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have ported it as is, but is there any reason why do that in translator instead of using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that Is a separate discussion. Unifying reports would be a good option but we would definitely have to push some things uostream before. For example, we include more information on debug level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @josevalim you mean in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean we show more information in general. Compare both reports in debug mode for a crashed GenServer and you will see the differences. :) |
||
|
|
||
| def translate(_min_level, :error, :format, message) do | ||
| case message do | ||
| {'Error in process ' ++ _, [pid, node, {reason, stack}]} -> | ||
| reason = Exception.normalize(:error, reason, stack) | ||
|
|
||
|
|
||
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.
Fantastic work!