Traces all function calls from a package and writes them to file with timestamps and callstack depth. Should always be used in combination with untrace_package() to untrace the package after use. For example trace_package("graphics"); on.exit(untrace_package("graphics"). See examples for more details.
Details
Some function define their own on.exit() handlers with option add = FALSE. For those functions, exit tracing is impossible (as described in trace()). For now those functions have to be detected and ignored manually by the user using argument funign.
Examples
if (FALSE) { # \dontrun{
# Trace all function from the graphics package, except for `plot.default`
# as it defines its own on.exit() handler, i.e. exit tracing is impossible.
local({
trace_package("graphics", funign = "plot.default")
on.exit(untrace_package("graphics"), add = TRUE)
plot(1:10)
})
} # }