Skip to content

Commit ae6cac6

Browse files
authored
feat: add mlr3 base logger (#287)
* feat: add mlr3 base logger * ...
1 parent deab7bc commit ae6cac6

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

R/zzz.R

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,14 @@
1717
x$add("bbotk.backup", load_callback_backup)
1818
x$add("bbotk.async_freeze_archive", load_callback_freeze_archive)
1919

20-
lg = lgr::get_logger("bbotk")
20+
lg = lgr::get_logger("mlr3/bbotk")
2121
assign("lg", lg, envir = parent.env(environment()))
2222
f = function(event) {
2323
event$msg = paste("[bbotk]", event$msg)
2424
TRUE
2525
}
2626
lg$set_filters(f)
2727

28-
register_namespace_callback("bbotk", "mlr3", function(pkgname, pkgpath) {
29-
x = utils::getFromNamespace("mlr_reflections", ns = "mlr3")
30-
if (is.list(x$loggers)) { # be backward compatible with mlr3 <= 0.13.0
31-
x$loggers[["bbotk"]] = lg
32-
}
33-
})
34-
3528
if (Sys.getenv("IN_PKGDOWN") == "true") {
3629
lg$set_threshold("warn")
3730
}

tests/testthat/setup.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ old_opts = options(
77
# https://github.com/HenrikBengtsson/Wishlist-for-R/issues/88
88
old_opts = lapply(old_opts, function(x) if (is.null(x)) FALSE else x)
99

10-
lg_bbotk = lgr::get_logger("bbotk")
10+
lg_bbotk = lgr::get_logger("mlr3/bbotk")
1111
lg_rush = lgr::get_logger("rush")
1212

1313
old_threshold_bbotk = lg_bbotk$threshold

0 commit comments

Comments
 (0)