hook
argument to
make()
that redirects output and error messagesR/hooks.R
Most users do not need to micromanage hooks.
silencer_hook(code)
code | code to run to build the target. |
---|
A function that you can supply to the hook
argument
of make()
.
make()
, message_sink_hook()
,
output_sink_hook()
# NOT RUN { test_with_dir("Quarantine side effects.", { # Test out the silencer hook on its own. try( silencer_hook({ cat(1234) stop(5678) }), silent = FALSE ) # Make a new workflow plan. x <- drake_plan(loud = cat(1234), bad = stop(5678)) # Test out the silencer hook on a drake project. # All output should be suppressed. try(make(x, hook = silencer_hook), silent = FALSE) }) # }