Skip to content

Commit

Permalink
register teal.logger handlers; replace few loggers with base (#1081)
Browse files Browse the repository at this point in the history
close insightsengineering/coredev-tasks#502
test with insightsengineering/teal.logger#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 <[email protected]>
  • Loading branch information
pawelru authored Mar 20, 2024
1 parent 04b4e20 commit c5ea0dd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/landing_popup_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion R/reporter_previewer_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
Expand Down
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Set up the teal logger instance
teal.logger::register_logger("teal")
teal.logger::register_handlers("teal")

invisible()
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/setup-logger.R
Original file line number Diff line number Diff line change
@@ -1 +1 @@
logger::log_appender(function(...) {}, namespace = "teal")
logger::log_appender(function(...) NULL, namespace = "teal")

0 comments on commit c5ea0dd

Please sign in to comment.