tests/testthat/helpers-logging.R

expect_file_contains <- function(outfile, regex) {
  expect_true(file.exists(outfile))

  if (file.exists(outfile)) {
    content <- readLines(outfile)

    expect_true(any(grepl(regex, content)))
  }
}

Try the log4r package in your browser

Any scripts or data that you put into this service are public.

log4r documentation built on Nov. 4, 2021, 9:09 a.m.