Skip to content

Commit

Permalink
allow character loggers in as_LogEvent.list
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-fleck committed Sep 5, 2022
1 parent cacbfd8 commit c725c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/LogEvent.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ LogEvent <- R6::R6Class(
msg = NA,
...
){
assert(inherits(logger, "Logger"), "Logger must be a <Logger> object, not a", class_fmt(logger))
assert(inherits(logger, "Logger"), "Logger must be a <Logger> object, not a ", class_fmt(logger))

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

if (is.null(x[["logger"]])){
x[["logger"]] <- get_logger()
} else if (is.character(x[["logger"]])){
x[["logger"]] <- get_logger(x[["logger"]])
}

# smartly rename timestamp fields from ElasticSearch/Logstash
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
0 errors | 0 warnings | 0 note

Rebuild docs for R 4.2.0

*resubmission* to fix minor error when priting loggers

0 comments on commit c725c92

Please sign in to comment.