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

[Bug]: Possible problem if {logger} releases new version #60

Closed
3 tasks done
averissimo opened this issue Sep 6, 2023 · 1 comment
Closed
3 tasks done

[Bug]: Possible problem if {logger} releases new version #60

averissimo opened this issue Sep 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@averissimo
Copy link
Contributor

averissimo commented Sep 6, 2023

What happened?

Current version of master from the {logger} package breaks an example on {teal.logger}. (this was detected by {verdepcheck})

Upstream issue daroczig/logger#120 and PR: daroczig/logger#121 daroczig/logger#125

The problem is that logger::log_appender determines the function name on Sys.call() and mapply doesn't use a direct call.

I've submitted a PR upstream that would solve this. If it doesn't go ahead we can mitigate this by using the trick below:

diff --git a/R/supress_logs.R b/R/supress_logs.R
index 4291111..5127d2f 100644
--- a/R/supress_logs.R
+++ b/R/supress_logs.R
@@ -17,6 +17,8 @@ suppress_logs <- function() {
   old_log_appenders <- lapply(logger::log_namespaces(), function(ns) logger::log_appender(namespace = ns))
   old_log_namespaces <- logger::log_namespaces()
   logger::log_appender(logger::appender_file(nullfile()), namespace = logger::log_namespaces())
-  withr::defer_parent(mapply(logger::log_appender, old_log_appenders, old_log_namespaces))
+
+  log_appender <- function(appender, namespace) logger::log_appender(appender, namespace)
+  withr::defer_parent(mapply(log_appender, old_log_appenders, old_log_namespaces))
   invisible(NULL)
 }

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@averissimo averissimo added the bug Something isn't working label Sep 6, 2023
@averissimo averissimo changed the title [Bug]: Possible problem in the future with {logger} [Bug]: Possible problem if {logger} releases new version Sep 6, 2023
@averissimo averissimo mentioned this issue Sep 20, 2023
11 tasks
@averissimo
Copy link
Contributor Author

averissimo commented Oct 25, 2023

This was solved upstream! 🎉

max strategy on {verdepcheck} has now passed on the automated workflow.

Scheduled 🕰️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant