knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This package provides logging if the logger package is installed. In order to view the logs, add appenders and layouts to the "chex" namespace.

library(chex)
library(logger)

log_appender(appender_console, namespace = "chex")
log_layout(layout_glue_colors, namespace = "chex")

results <- check_that(mtcars, is.data.frame, is.character)

The default log levels can be changed using the options CHEX_PASS_LOG_LEVEL and CHEX_FAIL_LOG_LEVEL.

options("CHEX_PASS_LOG_LEVEL" = logger::INFO, "CHEX_FAIL_LOG_LEVEL" = logger::INFO)

results <- check_that(mtcars, is.data.frame, is.character)


shunsambongi/chex documentation built on Aug. 21, 2022, 5:19 a.m.