diff --git a/DESCRIPTION b/DESCRIPTION index b638883..2de9416 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,12 +28,12 @@ Imports: bbotk, paradox, data.table, - loggr + logger, + crayon LinkingTo: Rcpp Remotes: - traitecoevo/plant, - smbache/loggr + traitecoevo/plant@develop Suggests: testthat (>= 3.0.0), parallel diff --git a/R/logging.R b/R/logging.R index 030680e..21cbef7 100644 --- a/R/logging.R +++ b/R/logging.R @@ -1,9 +1,11 @@ -plant_log_info <- function(...) { - loggr::log_info(..., package="plant", pid=Sys.getpid()) +plant_log_info <- function(message, routine=NULL, ...) { + if (!is.null(routine)) message <- paste0(crayon::yellow(routine), "> ", message) + logger::log_info(message, namespace="plant", .topenv=parent.frame()) } -plant_log_debug <- function(...) { - loggr::log_debug(..., package="plant", pid=Sys.getpid()) +plant_log_debug <- function(message, routine=NULL, ...) { + if (!is.null(routine)) message <- paste0(crayon::yellow(routine), "> ", message) + logger::log_debug(message, namespace="plant", .topenv=parent.frame()) } plant_log_max_fitness <- function(...) {