-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
I have an algorithm which is divided in various steps, all of them called inside a to_run file.
I want to log not only the errors but the traceback too.
I have written a function that does that:
log_traceback <- function(file_log) {
file_log <- readLines(file_logfile_log)
if (substr(tail(file_log, 1), start = 1, stop = 5) == "ERROR"){
invisible(lapply(.traceback(), log_error))
}
}However the function works only when I call it and not when the errors occur.
This means that after each step I would need to call the function which is not ideal for various reasons. (Otherwise the traceback will be overwritten by the next error)
Would it be possible to add an option for logging the traceback inside the log_errors() function? (Or create a log_traceback function)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed