#' Query the server logs
#'
#' @param collapse an optional character string to separate the
#' lines in a single character string.
#' @param just_errors logical, default [FALSE]. Set to [TRUE] to return
#' just the lines that contain the term "error", which can be useful
#' in debugging or validating bulk imports.
#' @inheritParams vos_kill
#' @export
#' @return Virtuoso logs as a character vector.
#' @seealso [vos_start()]
#' @examples
#' if(has_virtuoso())
#' vos_log()
#'
vos_log <- function(p = NA, collapse = NULL, just_errors = FALSE) {
if(is_solaris()){
warning("Virtuoso not available for Solaris", call. = FALSE)
return("")
}
p <- vos_process(p)
if (!inherits(p, "ps_handle")) return("")
err_file <- file.path(vos_logdir(), "virtuoso.log")
if(!file.exists(err_file)) return("")
log <- readLines(err_file)
if (just_errors) {
return(log[grepl("error", log)])
}
paste(log, collapse = collapse)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.