Skip to content

Flush error_logger before capturing #5280

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

Merged
merged 5 commits into from
Oct 1, 2016
Merged

Flush error_logger before capturing #5280

merged 5 commits into from
Oct 1, 2016

Conversation

fishcakez
Copy link
Member

processes. It is possible to ensure explicit log messages from other
processes are captured by waiting for their exit or monitor
signal. This does not guarantee to capture VM generated log messages
when a process spawned using a `spawn` BIF does not catch an exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've definitely heard the term BIF used in erlang docs, but don't think I've encountered it in the Elixir docs so I've assumed it wasn't really a term used by Elixir. Should this be Kernel.spawn or similar instead?

@myronmarston
Copy link
Contributor

👍 Thanks, @fishcakez!

when a process is spawned using a low level `Kernel` spawn function (e.g.
`Kernel.spawn/1`) does not catch an exception. A `Task`, or other OTP
process, will send explicit logs that are sent before its exit or monitor
signal and will not cause VM generated log messages.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@myronmarston is this description clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better, but I think the "does not catch an exception" part is a bit confusing. This spawned process does not catch an exception, but I don't think it's what you mean:

spawn(fn -> :ok end)

Maybe "raises an unhandled exception" or just "crashes" or something similar would be clearer?

when a process is spawned using a low level `Kernel` spawn function (e.g.
`Kernel.spawn/1`) raises an exception that isn't rescued or a thow that
isn't caught. A `Task`, orther OTP process, will send explicit logs that
are sent before its exit or monitor signal and will not cause VM generated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@myronmarston how about this rewording?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much clearer. I found a couple more grammar/spelling issues. I'm happy with it once those are addressed :).

processes are captured by waiting for their exit or monitor
signal. This does not guarantee to capture VM generated log messages
when a process is spawned using a low level `Kernel` spawn function (e.g.
`Kernel.spawn/1`) raises an exception that isn't rescued or a thow that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/thow/throw/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@fishcakez
Copy link
Member Author

Please don't squash/merge before #5262 and please do backport to v1.3 once merged.

processes. It is possible to ensure explicit log messages from other
processes are captured by waiting for their exit or monitor
signal. This does not guarantee to capture VM generated log messages
when a process is spawned using a low level `Kernel` spawn function (e.g.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammatically, "process is spawned...raises" is awkward. "process that is spawned...raises" reads better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

signal. This does not guarantee to capture VM generated log messages
when a process is spawned using a low level `Kernel` spawn function (e.g.
`Kernel.spawn/1`) raises an exception that isn't rescued or a throw that
isn't caught. A `Task`, orther OTP process, will send explicit logs that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/orther/or other/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@fishcakez
Copy link
Member Author

English is my native language ❤️

@josevalim josevalim merged commit 2c61d3e into master Oct 1, 2016
@josevalim
Copy link
Member

❤️ 💚 💙 💛 💜

@josevalim josevalim deleted the jf-capture-log branch October 1, 2016 08:38
josevalim pushed a commit that referenced this pull request Oct 1, 2016
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants