R/mdl_log.R

Defines functions mdl_log

Documented in mdl_log

#' Access Moodle's Logs
#'
#' Returns a reference to the log-table.
#'
#' @param tbl_prefix table prefix
#' @param con A database connection object
#'
#' @importFrom dplyr tbl
#' @importFrom dplyr select
#' @return A dbplyr reference object.
#' @export
mdl_log <- function(
  con = mdl_get_connection(),
  tbl_prefix = "mdl_") {

  if(!attr(con, "use_cache")){ #direct connection
    ret <-
      tbl(con, glue("{tbl_prefix}logstore_standard_log"))
  } else {
    ret <- tbl(con, "standard_log")
  }

  class(ret) <- c(class(ret), "mdl_log")
  ret
}

Try the moodleR package in your browser

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

moodleR documentation built on Aug. 15, 2022, 5:09 p.m.