From c5ea0dd192cc26a28ee2f90750ff4ea89c07c17d Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:22:40 +0100 Subject: [PATCH] register teal.logger handlers; replace few loggers with base (#1081) close https://github.com/insightsengineering/coredev-tasks/issues/502 test with https://github.com/insightsengineering/teal.logger/pull/73 I will keep it as a draft for the time being because this requires (currently) development version of `teal.logger`. This has impact on our release plan as `teal.logger` would have to be released first --------- Signed-off-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> --- DESCRIPTION | 2 +- R/landing_popup_module.R | 2 +- R/modules.R | 1 - R/reporter_previewer_module.R | 2 +- R/zzz.R | 1 + tests/testthat/setup-logger.R | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index df376b4fc3..10da486f98 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -50,7 +50,7 @@ Imports: shinyjs, stats, teal.code (>= 0.5.0), - teal.logger (>= 0.1.1), + teal.logger (>= 0.1.3.9013), teal.reporter (>= 0.2.0), teal.widgets (>= 0.4.0), utils diff --git a/R/landing_popup_module.R b/R/landing_popup_module.R index 0637d153af..752cb0576c 100644 --- a/R/landing_popup_module.R +++ b/R/landing_popup_module.R @@ -66,7 +66,7 @@ landing_popup_module <- function(label = "Landing Popup", ) checkmate::assert_multi_class(buttons, classes = c("shiny.tag", "shiny.tag.list")) - logger::log_info("Initializing landing_popup_module") + message("Initializing landing_popup_module") module <- module( label = label, diff --git a/R/modules.R b/R/modules.R index 933744cb51..751d34fb74 100644 --- a/R/modules.R +++ b/R/modules.R @@ -206,7 +206,6 @@ module <- function(label = "module", datanames <- filters msg <- "The `filters` argument is deprecated and will be removed in the next release. Please use `datanames` instead." - logger::log_warn(msg) warning(msg) } diff --git a/R/reporter_previewer_module.R b/R/reporter_previewer_module.R index 2ee7560684..eeba694a7f 100644 --- a/R/reporter_previewer_module.R +++ b/R/reporter_previewer_module.R @@ -24,7 +24,7 @@ reporter_previewer_module <- function(label = "Report previewer", server_args = checkmate::assert_list(server_args, names = "named") checkmate::assert_true(all(names(server_args) %in% names(formals(teal.reporter::reporter_previewer_srv)))) - logger::log_info("Initializing reporter_previewer_module") + message("Initializing reporter_previewer_module") srv <- function(id, reporter, ...) { teal.reporter::reporter_previewer_srv(id, reporter, ...) diff --git a/R/zzz.R b/R/zzz.R index cacaf7775b..817f9bae4b 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -10,6 +10,7 @@ # Set up the teal logger instance teal.logger::register_logger("teal") + teal.logger::register_handlers("teal") invisible() } diff --git a/tests/testthat/setup-logger.R b/tests/testthat/setup-logger.R index 1a7b3e5c5f..aeb7fb70bb 100644 --- a/tests/testthat/setup-logger.R +++ b/tests/testthat/setup-logger.R @@ -1 +1 @@ -logger::log_appender(function(...) {}, namespace = "teal") +logger::log_appender(function(...) NULL, namespace = "teal")