Closed GitHunter0 closed 4 months ago
This is a scoping issue -- if you are writing your own logger
wrapper, you would need to pass down properly the calling frame, call etc, e.g.:
custom_log_level <- function(level, ...){
txt <- toString(list(...))
log_level(txt, level=level, .logcall = sys.call(), .topcall = sys.call(-1), .topenv = parent.frame())
}
logger
is an amazing package, the only issue I'm having is that I can't create custom functions using it in Shiny context.Please, consider this MWE, while
log_level()
works,custom_log_level()
fails:The errors messages were:
Thank you