Skip to content

Commit

Permalink
expose 'trace_lists' param in 'inject_tracer' for #19
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jun 23, 2023
1 parent 3680363 commit 8e1bb3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion R/tracer-inject.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#'
#' @param f A function (that is, an object of class "function", and not a
#' character string).
#' @inheritParams trace_package
#' @return Nothing (will error on fail).
#'
#' @note The tracer is defined in the internal `typetracer_header()` function.
Expand All @@ -23,9 +24,10 @@
#' uninject_tracer (f)
#' # Traces may also be removed:
#' clear_traces ()
inject_tracer <- function (f) {
inject_tracer <- function (f, trace_lists = FALSE) {

checkmate::assert_function (f)
set_trace_list_option (trace_lists)

# save body for re-injection:
f_name <- deparse (substitute (f))
Expand Down
7 changes: 6 additions & 1 deletion man/inject_tracer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8e1bb3d

Please sign in to comment.