From 3336364f2c658a7d243b69fd7263ebca59615c4c Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:29:39 +0100 Subject: [PATCH] register teal.logger handlers (#354) close https://github.com/insightsengineering/coredev-tasks/issues/502 test with https://github.com/insightsengineering/teal.logger/pull/73 As a bonus, we can safely move `logger` to suggests (it's still used in tests) --------- Signed-off-by: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Co-authored-by: Dony Unardi --- .pre-commit-config.yaml | 1 - DESCRIPTION | 4 ++-- R/barplot.R | 2 +- R/boxplot.R | 2 +- R/forestplot.R | 2 +- R/km.R | 2 +- R/pca.R | 2 +- R/scatterplot.R | 2 +- R/volcanoplot.R | 2 +- R/zzz.R | 1 + 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c34dab47..84f0a320 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,6 @@ repos: - forcats - bioc::hermes - lifecycle - - logger - bioc::MultiAssayExperiment - rtables - S4Vectors diff --git a/DESCRIPTION b/DESCRIPTION index 62cf8386..a2d9141c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,6 @@ Imports: forcats, hermes (>= 1.7.1), lifecycle, - logger (>= 0.2.0), MultiAssayExperiment, rtables (>= 0.5.1), S4Vectors, @@ -50,7 +49,7 @@ Imports: stringr, SummarizedExperiment, teal.data (>= 0.3.0.9018), - teal.logger (>= 0.1.1), + teal.logger (>= 0.1.3.9013), teal.reporter (>= 0.2.0), teal.widgets (>= 0.4.0), tern (>= 0.7.10) @@ -60,6 +59,7 @@ Suggests: dplyr, globals, knitr, + logger (>= 0.2.0), matrixStats, R6, rmarkdown, diff --git a/R/barplot.R b/R/barplot.R index a221827e..11b5deb9 100644 --- a/R/barplot.R +++ b/R/barplot.R @@ -35,7 +35,7 @@ tm_g_barplot <- function(label, ), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_barplot") + message("Initializing tm_g_barplot") assert_string(label) assert_string(mae_name) assert_character(exclude_assays) diff --git a/R/boxplot.R b/R/boxplot.R index bdccb1db..7eccbb6f 100644 --- a/R/boxplot.R +++ b/R/boxplot.R @@ -36,7 +36,7 @@ tm_g_boxplot <- function(label, ), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_boxplot") + message("Initializing tm_g_boxplot") assert_string(label) assert_string(mae_name) assert_character(exclude_assays, any.missing = FALSE) diff --git a/R/forestplot.R b/R/forestplot.R index 36ce927b..8374e4da 100644 --- a/R/forestplot.R +++ b/R/forestplot.R @@ -54,7 +54,7 @@ tm_g_forest_tte <- function(label, post_output = NULL, plot_height = c(600L, 200L, 2000L), plot_width = c(1360L, 500L, 2000L)) { - logger::log_info("Initializing tm_g_forest_tte") + message("Initializing tm_g_forest_tte") assert_string(label) assert_string(adtte_name) assert_string(mae_name) diff --git a/R/km.R b/R/km.R index 9f72906e..b2ff88f6 100644 --- a/R/km.R +++ b/R/km.R @@ -57,7 +57,7 @@ tm_g_km <- function(label, ), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_km") + message("Initializing tm_g_km") assert_string(label) assert_string(adtte_name) assert_string(mae_name) diff --git a/R/pca.R b/R/pca.R index 1e1871e5..a873a29e 100644 --- a/R/pca.R +++ b/R/pca.R @@ -30,7 +30,7 @@ tm_g_pca <- function(label, exclude_assays = character(), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_pca") + message("Initializing tm_g_pca") assert_string(label) assert_string(mae_name) assert_tag(pre_output, null.ok = TRUE) diff --git a/R/scatterplot.R b/R/scatterplot.R index 2004144c..6a09a89e 100644 --- a/R/scatterplot.R +++ b/R/scatterplot.R @@ -35,7 +35,7 @@ tm_g_scatterplot <- function(label, ), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_scatterplot") + message("Initializing tm_g_scatterplot") assert_string(label) assert_string(mae_name) assert_character(exclude_assays, any.missing = FALSE) diff --git a/R/volcanoplot.R b/R/volcanoplot.R index 217ac1a0..a15989ba 100644 --- a/R/volcanoplot.R +++ b/R/volcanoplot.R @@ -30,7 +30,7 @@ tm_g_volcanoplot <- function(label, exclude_assays = character(), pre_output = NULL, post_output = NULL) { - logger::log_info("Initializing tm_g_volcanoplot") + message("Initializing tm_g_volcanoplot") assert_string(label) assert_string(mae_name) assert_character(exclude_assays) diff --git a/R/zzz.R b/R/zzz.R index 3009dba0..c317d6c9 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,3 +1,4 @@ .onLoad <- function(libname, pkgname) { # nolint teal.logger::register_logger(namespace = "teal.modules.hermes") + teal.logger::register_handlers("teal.modules.hermes") }