Skip to contents

Wrapper around 'trace' to untrace when finished

Usage

with_trace(
  x,
  where = topenv(parent.frame()),
  print = getOption("httptest.debug", FALSE),
  ...,
  expr
)

Arguments

x

Name of function to trace. See base::trace().

where

where to look for the function to be traced.

print

Logical: print a message every time the traced function is hit? Default is FALSE; note that in trace, the default is TRUE.

...

Additional arguments to pass to trace. At minimum, must include either tracer or exit.

expr

Code to run inside the context

Value

The result of expr