Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid logging handled exceptions #31

Open
aschmu opened this issue Aug 23, 2017 · 0 comments
Open

Avoid logging handled exceptions #31

aschmu opened this issue Aug 23, 2017 · 0 comments

Comments

@aschmu
Copy link

aschmu commented Aug 23, 2017

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.

@aschmu aschmu closed this as completed Aug 23, 2017
@aschmu aschmu changed the title Only log fatal errors Avoid logging handled exceptions Aug 23, 2017
@aschmu aschmu reopened this Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant