Running examples in ‘lgr-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Logger
> ### Title: Loggers
> ### Aliases: Logger Loggers
> 
> ### ** Examples
> 
> # lgr::lgr is the root logger that is always available
> lgr$info("Today is a good day")
INFO  [14:51:24.090] Today is a good day
> lgr$fatal("This is a serious error")
FATAL [14:51:24.091] This is a serious error
> 
> # Loggers use sprintf() for string formatting by default
> lgr$info("Today is %s", Sys.Date() )
INFO  [14:51:24.092] Today is 2025-12-06
> 
> # If no unnamed `...` are present, msg is not passed through sprintf()
> lgr$fatal("100% bad")  # so this works
FATAL [14:51:24.093] 100% bad
> lgr$fatal("%s%% bad", 100)  # if you use unnamed arguments, you must escape %
FATAL [14:51:24.094] 100% bad
> 
> # You can create new loggers with get_logger()
> tf <- tempfile()
> lg <- get_logger("mylogger")$set_appenders(AppenderFile$new(tf))
> 
> # The new logger passes the log message on to the appenders of its parent
> # logger, which is by default the root logger. This is why the following
> # writes not only the file 'tf', but also to the console.
> lg$fatal("blubb")
FATAL [14:51:24.097] blubb
> readLines(tf)
[1] "FATAL [2025-12-06 14:51:24.097] blubb"
> 
> # This logger's print() method depicts this relationship.
> child <- get_logger("lg/child")
> print(child)
<Logger> [info] lg/child

inherited appenders:
  console: <AppenderConsole> [all] -> console
> print(child$name)
[1] "lg/child"
> 
> # use formatting strings and custom fields
> tf2 <- tempfile()
> lg$add_appender(AppenderFile$new(tf2, layout = LayoutJson$new()))
> lg$info("Not all %s support custom fields", "appenders", type = "test")
INFO  [14:51:24.102] Not all appenders support custom fields {type: `test`}
> cat(readLines(tf), sep = "\n")
FATAL [2025-12-06 14:51:24.097] blubb
INFO  [2025-12-06 14:51:24.102] Not all appenders support custom fields {"type":"test"}
> cat(readLines(tf2), sep = "\n")
{"level":400,"timestamp":"2025-12-06 14:51:24","logger":"mylogger","caller":"(shell)","msg":"Not all appenders support custom fields","type":"test"}
> 
> # cleanup
> unlink(c(tf, tf2))
> lg$config(NULL)  # reset logger config
<Logger> [info] mylogger

inherited appenders:
  console: <AppenderConsole> [all] -> console
> 
> # LoggerGlue
> # You can also create a new logger that uses the awesome glue library for
> # string formatting instead of sprintf
> 
> if (requireNamespace("glue")){
+ 
+   lg <- get_logger_glue("glue")
+   lg$fatal("blah ", "fizz is set to: {fizz}", foo = "bar", fizz = "buzz")
+   # prevent creation of custom fields with prefixing a dot
+   lg$fatal("blah ", "fizz is set to: {.fizz}", foo = "bar", .fizz = "buzz")
+ 
+   #' # completely reset 'glue' to an unconfigured vanilla Logger
+   get_logger("glue", reset = TRUE)
+ 
+ }
FATAL [14:51:24.111] blah fizz is set to: buzz {foo: `bar`, fizz: `buzz`}
FATAL [14:51:24.153] blah fizz is set to: buzz {foo: `bar`}
<Logger> [info] glue

inherited appenders:
  console: <AppenderConsole> [all] -> console
> 
> 
> # Configuring a Logger
> lg <- get_logger("test")
> lg$config(NULL)  # resets logger to unconfigured state
<Logger> [info] test

inherited appenders:
  console: <AppenderConsole> [all] -> console
> 
> # With setters
> lg$
+   set_threshold("error")$
+   set_propagate(FALSE)$
+   set_appenders(AppenderConsole$new(threshold = "info"))
> 
> lg$config(NULL)
<Logger> [info] test

inherited appenders:
  console: <AppenderConsole> [all] -> console
> 
> # With a list
> lg$config(list(
+   threshold = "error",
+   propagate = FALSE,
+   appenders = list(AppenderConsole$new(threshold = "info"))
+ ))
<Logger> [error] test

appenders:
  [[1]]: <AppenderConsole> [info] -> console
> 
> lg$config(NULL)  # resets logger to unconfigured state
<Logger> [info] test

inherited appenders:
  console: <AppenderConsole> [all] -> console
> 
> # Via YAML
> cfg <- "
+ Logger:
+   threshold: error
+   propagate: false
+   appenders:
+     AppenderConsole:
+       threshold: info
+ "
> 
> lg$config(cfg)
Error in loadNamespace(x) : there is no package called ‘yaml’
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted