Skip to content

Avoid logging handled exceptions #31

@aschmu

Description

@aschmu

Hi I can't figure out how to do this, maybe this needs a pull request.
Basically what I mean to do is to source the following R script:

log_file("testloggr.log", overwrite = TRUE, INFO)
log_info("I want to log this to keep a trace")
e <- sin(pi/6)
#But I don't wish to see any traceback in the logfile for the following
try(log("e"))

#I certainly don't want to see any output from this
fun <- function() {
 a <- tryCatch(na.fail(NA),
           error = function(e) 1)
 a
}
fun()

The last function call writes a message to the logfile which I do not want.
Also for some weird reason if I change the INFO log level to DEBUG, there's no more log_info output. I find this strange since I assume DEBUG is a more verbose mode which should include INFO or maybe I'm missing something.

The use case is am running a bunch of R scripts from the command line and I wan't to log them properly for production mainly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions