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

.catch_and_log() requires passing arguments through ... by position rather than name #907

Open
simonpcouch opened this issue May 31, 2024 · 0 comments

Comments

@simonpcouch
Copy link
Contributor

.catch_and_log() works by passing its dots through to tune_log() and log_problems():

tune/R/logging.R

Lines 374 to 380 in a27512d

.catch_and_log <- function(.expr, ..., bad_only = FALSE, notes, catalog = TRUE) {
tune_log(..., type = "info", catalog = catalog)
tmp <- catcher(.expr)
new_notes <- log_problems(notes, ..., tmp, bad_only = bad_only)
assign("out_notes", new_notes, envir = parent.frame())
tmp$res
}

tune_log() and log_problems(), though, name their third and fourth (required) arguments, respectively—that function in the same way—with different names, which makes passing that argument by name rather than position impossible.

tune_log <- function(control, split = NULL, task, type = "success", catalog = TRUE) {

log_problems <- function(notes, control, split, loc, res, bad_only = FALSE) {

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