Skip to contents

Setup and return the logger

Usage

get_logger(
  format =
    "{sprintf(\"%-7s\", level)} [{format(time, \"%Y-%m-%d %H:%M:%S\")}] {msg}",
  appender = "stdout",
  level = "INFO"
)

Arguments

format

The format of the log message. This format will be passed to logger::layout_glue_generator. The default format will generate a log message like: INFO [2021-01-01 00:00:00] Hello world

appender

The appender to use. Default is "stdout" Either a string or a logger appender object. If string is provided, it will be converted to the corresponding logger appender object. For example, "stdout" will be converted to logger::appender_stdout

level

The log level. Default is "INFO" Either a string or a logger level object. If string is provided, it will be converted to the corresponding logger level object. For example, "INFO" will be converted to logger::INFO

Value

A list of logging functions