Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions R/task.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Task <- R6::R6Class(
#' @param dir The directory to write the log to.
#'
#' @return The path to the logged file, invisibly.
log = function(dir = vitals_log_dir()) {
log = function(dir = self$dir) {
if (!private$scored) {
cli::cli_abort(
"Task has not been scored yet. Run task$score() first."
Expand Down Expand Up @@ -401,15 +401,10 @@ Task <- R6::R6Class(
)

if (is.na(dir)) {
if (!is.na(self$dir)) {
dir <- self$dir
} else {
dir <- tempdir()
}
self$dir <- tempdir()
}

self$dir <- dir
log_path <- eval_log_write(eval_log, dir = dir)
log_path <- eval_log_write(eval_log, dir = self$dir)

invisible(log_path)
},
Expand Down
2 changes: 1 addition & 1 deletion man/Task.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading