Skip to content

Ensure invisibly returned objects are not printed in log#285

Open
parmsam-pfizer wants to merge 7 commits intomainfrom
275-invisibly-returned-objs
Open

Ensure invisibly returned objects are not printed in log#285
parmsam-pfizer wants to merge 7 commits intomainfrom
275-invisibly-returned-objs

Conversation

@parmsam-pfizer
Copy link
Collaborator

@parmsam-pfizer parmsam-pfizer commented Feb 25, 2026

Associated with #275.

Thank you for your Pull Request!

We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the logrx codebase remains robust and consistent.

The spirit of logrx

While many packages to facilitate the logging of code already exist in the R ecosystem, it is hard to find a solution that works well for clinical programming applications. Many logging implementations are more implicit and rely on user input to create the log for the execution of a script. While this is useful for logging specific events of an application, in clinical programming a log has a set purpose.

logrx is built around the concept of creating a log for the execution of an R script that provides an overview of what happened as well as the environment that it happened in. We set out to create a flexible logging utility that could provide the necessary information to anyone reviewing the code execution so they can recreate the execution environment and run the code for themselves. Please make sure your Pull Request meets this spirit of logrx.

Please check off each taskbox as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the dev branch until you have checked off each task.

  • The spirit of logrx is met in your Pull Request
  • Code is formatted according to the tidyverse style guide
  • Updated relevant unit tests or have written new unit tests. Remember to remove any configured log objects at the end of every test using log_remove().
  • Creation/updates to relevant roxygen headers and examples.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Run pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Address any updates needed for vignettes and/or templates
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue so that it closes after successful merging.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@parmsam-pfizer parmsam-pfizer changed the title Add visible = TRUE to purrr::safely() call for run_safely Ensure invisibly returned objects are not printed in log Feb 25, 2026
@parmsam-pfizer parmsam-pfizer marked this pull request as draft March 4, 2026 18:48
@parmsam-pfizer
Copy link
Collaborator Author

Still working on this. Should have update soon.

@parmsam-pfizer parmsam-pfizer self-assigned this Mar 4, 2026
@parmsam-pfizer parmsam-pfizer requested a review from kodesiba March 4, 2026 20:40
@parmsam-pfizer
Copy link
Collaborator Author

Sorry, for the delay. Should be updated now. Please let me know if you have any questions or suggestions. Feel free to make any needed edits.

@parmsam-pfizer parmsam-pfizer marked this pull request as ready for review March 4, 2026 20:41
@bms63 bms63 linked an issue Mar 5, 2026 that may be closed by this pull request
kodesiba
kodesiba previously approved these changes Mar 6, 2026
@kodesiba
Copy link
Collaborator

kodesiba commented Mar 6, 2026

I have this tagged in the callr update to check out but the tests being here already is really good to have

Comment on lines +1 to +3
my_fun <- function(x) {
return(invisible(x))
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this enough?? - can we make something a little more involved to make sure nothing is carried through?

unsure if this even returns anything.

the culprit is gt package which returns a lot of html formatting into the console which runs the risk of getting printed to our log

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would agree with adding a test for gt, this is the function from the reprex though

@kodesiba kodesiba self-requested a review March 6, 2026 19:56
@kodesiba kodesiba dismissed their stale review March 6, 2026 19:56

putting back in review for more testing

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

Successfully merging this pull request may close these issues.

Bug: Invisibly returned objects are printed in the log

3 participants