daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
280 stars 41 forks source link

Custom Log Level #71

Closed camult closed 3 years ago

camult commented 3 years ago

Is there any possibility to implement a customized log level different from the default?

daroczig commented 3 years ago

I think so:

> library(logger)
> FYI <- structure(450L, level = 'FYI', class = c('loglevel', 'integer'))
> log_threshold(FYI)
> log_debug('ping')
> log_level(FYI, 'ping')
FYI [2021-03-03 16:30:04] ping
> log_info('pong')
INFO [2021-03-03 16:30:04] pong

Does this work for you?

camult commented 3 years ago

That works perfectly. Thanks.