daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
287 stars 42 forks source link

log_errors in rmarkdown #104

Closed jthorey closed 2 years ago

jthorey commented 2 years ago

I try to put errors in the log file from rmarkdown, but the compilation of the following rmarkdown fails :


title: "test logger" output: html_document

library(logger)
log_errors()

with the error Error in globalCallingHandlers(error = function(m) { : should not be called with handlers on the stack.

daroczig commented 2 years ago

Unfortunately, both R markdown and logger try to use the same globalCallingHandlers -- which is not supported. Honestly, I do not see a way to overcome this limitation, see #70 for more details (marking as duplicated issue).