-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
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:
googlesheets4/R/range_speedread.R
Lines 94 to 100 in 55cd9fd
| msg <- glue( | |
| " | |
| Reading from {.s_sheet {x$name}}<<sheet_msg>><<range_msg>>.", | |
| .open = "<<", | |
| .close = ">>" | |
| ) | |
| gs4_bullets(c(v = msg)) |
Lines 131 to 140 in 55cd9fd
| 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) | |
| } |
Lines 80 to 82 in 55cd9fd
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels