Set the stdout/stderr event handler.
Pass null
to disable this specific handler.
Only accepts 'stdout' and 'stderr' as the event
argument. Overwrites the previous handler.
the event to listen on
the callback
Reset this StdoutRedirectGuard
instance.
After this call, the stdout/stderr will no longer
be redirected to the specified methods and any call
to this class will throw an error as this counts as destroyed.
The class guarding the stdout redirect. Keep this instance in scope to not lose the redirect. As soon as this gets garbage collected, the redirection of the stdout/stderr will be stopped. Only one instance of this can exist at a time. Call reset to stop redirecting the program output and release this class instance early.
This can be created by calling stdout.enableRedirect.
Example
See also