Log a message with timestamp
log_message.RdPrints a timestamped message to the console. Supports glue-style interpolation of variables from the calling environment. Optionally prints and returns a variable value, useful for debugging pipelines.
Examples
# Simple message
log_message("Starting the process...")
#> [2026-04-03 09:19:36] Starting the process...
# With variable interpolation
iso3 <- "KEN"
log_message("Processing {iso3}...")
#> [2026-04-03 09:19:36] Processing KEN...
# With variable return (useful in pipelines)
result <- log_message("Computed value", 42)
#> [2026-04-03 09:19:36] Computed value: 42