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
37
37
Returns the binary which is the captured output.
38
38
39
39
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.
41
49
42
50
Note that when the `async` is set to `true`,
43
51
the messages from another test might be captured.
@@ -59,6 +67,7 @@ defmodule ExUnit.CaptureLog do
59
67
{ :ok , string_io } = StringIO . open ( "" )
60
68
61
69
try do
70
+ _ = :gen_event . which_handlers ( :error_logger )
62
71
:ok = add_capture ( string_io , opts )
63
72
ref = ExUnit.CaptureServer . log_capture_on ( self ( ) )
64
73
You can’t perform that action at this time.
0 commit comments