Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: logger
Title: A Lightweight, Modern and Flexible Logging Utility
Version: 0.4.3
Version: 0.4.3.9000
Date: 2026-08-23
Authors@R: c(
person("Gergely", "Daróczi", , "daroczig@rapporter.net", role = c("aut", "cre"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# logger (development version)

* `log_with_separator()` now correctly evaluates in the caller environment, so it behaves as expected when wrapped in a function call. (#245)

# logger 0.4.3 (2026-08-23)

Maintenance release:
Expand Down
2 changes: 1 addition & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ log_with_separator <- function(...,
.topenv = parent.frame()
)

message <- do.call(eval(log_formatter()), list(...))
message <- do.call(eval(log_formatter()), list(...), envir = parent.frame())
message <- strwrap(message, max(0, width - base_info_chars - 4))
message <- sapply(message, function(m) {
paste0(
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ test_that("log with separator", {
local_test_logger()
expect_output(log_with_separator(42), "===")
expect_output(log_with_separator("Boo!", level = FATAL, width = 120), width = 120)
test_fct <- function(x) log_with_separator("{x}")
expect_output(test_fct("Hello World!"))
})

test_that("log failure", {
Expand Down
Loading