From 9a109449227474cbccaf7303a12ea16c968b5dd1 Mon Sep 17 00:00:00 2001 From: maksymis <32574056+maksymiuks@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:22:00 +0100 Subject: [PATCH 1/2] Fix warnings emmited by log_call_location --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/utils.R | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d9644cf7..5f5ad633 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: logger Title: A Lightweight, Modern and Flexible Logging Utility -Version: 0.4.1.9001 +Version: 0.4.1.9002 Date: 2025-10-29 Authors@R: c( person("Gergely", "Daróczi", , "daroczig@rapporter.net", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 36194a1c..f6b978f9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,8 @@ New features and quality of life improvements: * Added `appender_ntfy()` to use {ntfy} as an appender (#240, @jonocarroll) +* `normalizePath()` in the `log_call_location()` no longer triggers warning + if the package source does not exist (#241, @maksymiuks) # logger 0.4.1 (2025-09-08) diff --git a/R/utils.R b/R/utils.R index 7a32a5ff..5592f729 100644 --- a/R/utils.R +++ b/R/utils.R @@ -61,7 +61,7 @@ log_call_location <- function(.logcall) { loc$line <- ref[1L] file <- attr(ref, "srcfile") if (!is.null(file)) { - loc$path <- normalizePath(file$filename, winslash = "/") + loc$path <- normalizePath(file$filename, winslash = "/", mustWork = FALSE) } break } From 0372a059f523930438fd65d87835ef23b6ce9e13 Mon Sep 17 00:00:00 2001 From: maksymis <32574056+maksymiuks@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:35:03 +0100 Subject: [PATCH 2/2] Fix lintr job --- R/helpers.R | 4 ++-- R/layouts.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/helpers.R b/R/helpers.R index e2793503..dbe7544c 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -72,9 +72,9 @@ log_eval <- function(expr, level = TRACE, multiline = FALSE) { ## return the results of the call if (res$visible == TRUE) { - return(res$value) + res$value } else { - return(invisible(res$value)) + invisible(res$value) } } diff --git a/R/layouts.R b/R/layouts.R index 5ab4c264..3225c99f 100644 --- a/R/layouts.R +++ b/R/layouts.R @@ -429,7 +429,7 @@ layout_syslognet <- structure( "DEBUG" = "DEBUG", "TRACE" = "DEBUG" ) - return(ret) + ret }, generator = quote(layout_syslognet()) )