Skip to content

Commit

Permalink
Fixed Failed Pipeline (#89)
Browse files Browse the repository at this point in the history
Fixes #88
  • Loading branch information
donyunardi authored Aug 27, 2024
1 parent d89dcf6 commit f7f6eb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Suggests:
rmarkdown (>= 2.23),
testthat (>= 3.1.7)
VignetteBuilder:
knitr
knitr,
rmarkdown
RdMacros:
lifecycle
Config/Needs/verdepcheck: tidyverse/glue, r-lib/lifecycle,
Expand Down
12 changes: 10 additions & 2 deletions R/supress_logs.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @return `NULL` invisible
#' @export
#' @examples
#' @examplesIf require("logger") && require("testthat")
#' testthat::test_that("An example test", {
#' suppress_logs()
#' testthat::expect_true(TRUE)
Expand All @@ -17,6 +17,14 @@ suppress_logs <- function() {
old_log_appenders <- lapply(logger::log_namespaces(), function(ns) logger::log_appender(namespace = ns))
old_log_namespaces <- logger::log_namespaces()
logger::log_appender(logger::appender_file(nullfile()), namespace = logger::log_namespaces())
withr::defer_parent(mapply(logger::log_appender, old_log_appenders, old_log_namespaces))
withr::defer_parent(
mapply(
function(appender, namespace) {
logger::log_appender(eval(appender), namespace)
},
old_log_appenders,
old_log_namespaces
)
)
invisible(NULL)
}
3 changes: 2 additions & 1 deletion man/suppress_logs.Rd

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

0 comments on commit f7f6eb9

Please sign in to comment.