Most users do not need to micromanage hooks.

message_sink_hook(code)

Arguments

code

code to run to build the target.

Value

A function that you can supply to the hook argument of make().

See also

make(), silencer_hook(), output_sink_hook()

Examples

# NOT RUN {
test_with_dir("Quarantine side effects.", {
# Test out the message sink hook on its own.
try(
  message_sink_hook({
    cat(1234)
    stop(5678)
  }),
  silent = FALSE
)
# Create a new workflow plan.
x <- drake_plan(loud = cat(1234), bad = stop(5678))
# Run the project. All messages should be suppressed.
try(make(x, hook = message_sink_hook), silent = FALSE)
})
# }