Skip to content

Commit c725c92

Browse files
committed
allow character loggers in as_LogEvent.list
1 parent cacbfd8 commit c725c92

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

R/LogEvent.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ LogEvent <- R6::R6Class(
5555
msg = NA,
5656
...
5757
){
58-
assert(inherits(logger, "Logger"), "Logger must be a <Logger> object, not a", class_fmt(logger))
58+
assert(inherits(logger, "Logger"), "Logger must be a <Logger> object, not a ", class_fmt(logger))
5959

6060
# assign has less overhead than [[ and event creation needs to be as fast
6161
# as possible
@@ -157,6 +157,8 @@ as_LogEvent.list <- function(x, ...){
157157

158158
if (is.null(x[["logger"]])){
159159
x[["logger"]] <- get_logger()
160+
} else if (is.character(x[["logger"]])){
161+
x[["logger"]] <- get_logger(x[["logger"]])
160162
}
161163

162164
# smartly rename timestamp fields from ElasticSearch/Logstash

cran-comments.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
0 errors | 0 warnings | 0 note
44

55
Rebuild docs for R 4.2.0
6+
7+
*resubmission* to fix minor error when priting loggers

0 commit comments

Comments
 (0)