Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# vitals (development version)


* `$eval()` and `$log()` will now write log files to the same default
directory--the one specified when initializing the Task object.
Previously, `$eval()` wrote to that directory, while `$log()` wrote
to `vitals_log_dir()` (#158 by @SokolovAnatoliy).

* Manifest files for deployed logs are now named `listing.json` rather than `logs.json` for compatibility with newer Inspect versions.

* Removed dependency on the rstudioapi package (#146).
Expand Down
11 changes: 3 additions & 8 deletions R/task.R
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,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 @@ -417,15 +417,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