File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,15 @@ defmodule ExUnit.CaptureLog do
3737 Returns the binary which is the captured output.
3838
3939 This function mutes the `:console` backend
40- and captures any log messages sent to Logger.
40+ and captures any log messages sent to Logger from the calling
41+ processes. It is possible to ensure explicit log messages from other
42+ processes are captured by waiting for their exit or monitor
43+ signal. This does not guarantee to capture VM generated log messages
44+ when a process that is spawned using a low level `Kernel` spawn function
45+ (e.g. `Kernel.spawn/1`) raises an exception that isn't rescued or a throw
46+ that isn't caught. A `Task`, or other OTP process, will send explicit logs
47+ that are sent before its exit or monitor signal and will not cause VM
48+ generated log messages.
4149
4250 Note that when the `async` is set to `true`,
4351 the messages from another test might be captured.
@@ -59,6 +67,7 @@ defmodule ExUnit.CaptureLog do
5967 { :ok , string_io } = StringIO . open ( "" )
6068
6169 try do
70+ _ = :gen_event . which_handlers ( :error_logger )
6271 :ok = add_capture ( string_io , opts )
6372 ref = ExUnit.CaptureServer . log_capture_on ( self ( ) )
6473
You can’t perform that action at this time.
0 commit comments