I'm currently in the process of updating a large number of RMarkdown reports spread across a lot of repos to R4.3 - and I'm taking the opportunity to update their renv.lock files to modern tidyverse and rmarkdown/knitr as I go.
This area is causing me some challenges with our debug and monitoring logging at the moment.
We've traditionally setup our RMarkdown's so that they use a Log function which is a basic wrapper of message to output status information which helps us identify what's broken when an Rmd rendering job fails on our production servers - e.g. we might have blocks like:
---{r datafetch, message=FALSE, warning=FALSE}
Log("Fetching data for", param$code, "on", param$report_date)
data <- httr_fetch_for_data(some_url)
Log("Data fetched", nrow(data))
# ... data shaping, presentation added, etc
Log("Shaped data complete", nrow(some_shaped_data))
gt:gt(some_shaped_data) |> formatted()
---
On upgrading to the latest evaluate and knitr, this functionality now seems to be broken - our report knitting just outputs minimal debug info. We've found we can get some of the previous info back by call knitr::chunk_opts$set(message = NA, warning=NA) in our job processing code which is called before rmarkdown::render().
However, this doesn't seem to entirely work for us - especially because many of our Rmd's also have local overrides in place - e.g. many report authors have added knitr::chunk_opts$set(message=FALSE) lines or have used {r cars, message=FALSE} blocks locally in their R code in order to make their reports look beautiful during local debugging - and these local overrides replace our global NA setting.
If necessary, we can go through all these reports and replace all the blocks with e.g. {r cars, message=NA} but I'm wondering if this is really the right way to go. Is there any way we can instead set a global override here to ensure all message and warning information is passed to the console? As someone who often has to find out where problems are, I've always appreciated and used the console message output, and I would really appreciate having a global "please be verbose" setting that I can turn back on without having to go in and edit lots of individual Rmd blocks - plus trying to retrain lots of users who've got very used to adding message=FALSE.
PS I appreciate I'm also late to the discussion here too - renv has done a magnificent job of providing us with version stability this year, but it does mean we don't notice problems like this very quickly after package updates :)