I was trying to figure out how to quiet the sheets output messages:
✔ Reading from ${BOOK_TITLE}.
✔ Range ''${SHEET_TITLE}''.
Naturally, I checked ?read_sheet to figure this out, expecting a quiet= option.
I found none, and might have concluded it's not possible to do so, but I doggedly chased down the source code, clicking through 3 definitions before finding it's possible:
|
msg <- glue( |
|
" |
|
Reading from {.s_sheet {x$name}}<<sheet_msg>><<range_msg>>.", |
|
.open = "<<", |
|
.close = ">>" |
|
) |
|
gs4_bullets(c(v = msg)) |
|
gs4_bullets <- function(text, .envir = parent.frame()) { |
|
quiet <- gs4_quiet() %|% is_testing() |
|
if (quiet) { |
|
return(invisible()) |
|
} |
|
cli::cli_div(theme = gs4_theme()) |
|
# TODO: fix this: when I switched from cli::cli_bullets() to |
|
# cli::cli_inform(), my custom bullet styling was lost (suppressing colour) |
|
cli::cli_bullets(text, .envir = .envir) |
|
} |
|
gs4_quiet <- function() { |
|
getOption("googlesheets4_quiet", default = NA) |
|
} |
It would be nice to have this directly as an option; otherwise, one of the @examples could set this option to demonstrate it.
I was trying to figure out how to quiet the sheets output messages:
Naturally, I checked
?read_sheetto figure this out, expecting aquiet=option.I found none, and might have concluded it's not possible to do so, but I doggedly chased down the source code, clicking through 3 definitions before finding it's possible:
googlesheets4/R/range_speedread.R
Lines 94 to 100 in 55cd9fd
googlesheets4/R/utils-ui.R
Lines 131 to 140 in 55cd9fd
googlesheets4/R/utils-ui.R
Lines 80 to 82 in 55cd9fd
It would be nice to have this directly as an option; otherwise, one of the
@examplescould set this option to demonstrate it.