AppenderConsole
now accept aconnection
argument. If called from a{knitr}
rendering process, log messages are now output tostderr
instead ofstdout
by default, to avoid polluting markdown documents (#62, thx @gadenbuie).
-
%k
and%K
parameters informat.LogEvent
now work as expected when using crayon terminal colours (#52). -
Fix default format string for
LayoutGlue
which was usingmsg
instead of{msg}
(#54, thx @mmuurr) -
Update docs to use the more common term "structured logging" instead of "custom fields" where appropriate
-
as_event_list.data.frame
now really returns a list ofLogEvents
-
added
as_LogEvent()
to coerce various event-like objects toLogEvents
-
rebuild docs for R 4.2.0
-
logger_index()
returns adata.frame
with metadata on all registered loggers (#47) (thanks @Fuco1) -
export new
string_repr()
generic that is used to layout R objects for formatted log message output (#48, thanks @mmuurr) -
The
$log()
method of Logger and LoggerGlue now unpacks conditions (except if they are supplied as a named argument) (#45, thanks @mmuurr) -
Fix some timezone related tests for CRAN
-
Deprecated the
create_file
argument ofAppenderFileRotating*
. This is now hardcoded toTRUE
(becauseFALSE
doesn't really make sense here). -
default_exception_handler()
now throws more informative warnings if an error is encountered during logging. -
drop tests for deprecated future plans to ensure compatibility with upcoming versions of future (#43)
-
Moved more complex Appenders to package lgrExtra. This includes database Appenders, email and push notifications and AppenderDt (in-memory
data.tables
). -
AppenderFile$show()
can now filter log files formatted by LayoutFormat by log level. Be aware that this justgreps
through the file and therefore will return false positives on lines where the log message contains strings that can be interpreted as log levels. -
AppenderFile$show()
andAppenderFile$data
now dispatches toLayout$read()
andLayout$parse()
. This makes it possible to tie reading/parsing of log files to Layouts. -
Loggers gain a
list_log()
method. See https://github.com/s-fleck/joblog for an R package that leverages this feature to create custom log event types for tracking the status of cron jobs. -
Export more utility functions that are useful for creating custom Appenders; such as
standardize_threshold()
andevent_list()
. -
AppenderBuffer now defaults to
flush_threshold = NULL
(never flush because of the log level of an event) -
basic_config()
now works as documented for .jsonl files -
AppenderMemory gains a
$clear()
method that clears the buffer without sending the events to it's attached appenders -
LayoutJson gains a
timestamp_fmt
field that can be used for custom timestamp formats (#34) -
added
toString.LogEvent()
for compact representations of LogEvents -
lgr is now automatically tested for all major R version >= 3.2.0
-
AppenderMemory/AppenderBuffer:
flush_threshold
is now independent ofshould_flush
function.default_should_flush()
is no longer necessary and has been removed. -
Updated AppenderFileRotating and co for compatibility with rotor 0.3.0
-
Most errors now have appropriate subclasses
-
Logger$log()
dispatches to all appenders - even if some throw an error - instead of aborting after the first Appender that throws an error -
complete rewrite of the documentation to use the new roxygen2 features for R6 classes.
- Hotfix for compatibility with R < 3.6.0 (#32)
- Fixed a performance regression when looking up the parent of a Logger. This notably affected the performance of "do-nothing" logging (e.g. when a log message is discarded because it is below a loggers' threshold)
- Added AppenderSyslog for logging to syslog via rsyslog (thanks to atheriel)
-
Added
logger_tree()
which provides an overview of all registered loggers -
Added
print()
andformat()
methods for Appenders -
AppenderMemory
: addeddata
anddt
active fields (which return the log as a data.frame or data.table) -
Removed deprecated functions
FATAL()
,ERROR()
. Uselgr$fatal()
,lgr$error()
, ... instead. -
AppenderMemory
:$buffer_dt()
and$show()
now handle custom fields containing atomic vectors correctly
-
Added support for rotating log files via
AppenderFileRotating
,AppenderFileRotatingDate
andAppenderFileRotatingTime
. Requires the package rotor. -
functions like
show_log()
,show_data()
,... now accept logger names as well as Logger or Appender objects astarget
. -
AppenderFile$new()
now creates an empty file, or fails if it can't -
Improved support for RMariaDB and dropped support for RMySQL
-
Improved support for RPostgres and dropped support for RPostgreSQL
-
added
reset
argument toget_logger()
. This completely resets the configuration of the logger and also replaces special loggers (such asLoggerGlue
) with vanilla ones.
-
The root logger can now be configured via
options()
and/or environment variables (see?lgr
) -
basic_config()
now accepts thresholds ("info", "fatal") as arguments toconsole
andmemory
. -
The default config of the root logger has changed. It now only has a console appender and a default threshold of
"info"
. To get back the old behaviour runbasic_config(threshold = "all", console = "info", memory = "all")
. -
$config(NULL)
now resets a Logger to its default/unconfigured state -
$config()
now accepts YAML as well as JSON files (or YAML/JSON as a character string) -
with_log_level()
andwith_log_value()
now accept logger names as well as Logger objects as thelogger
argument -
get_logger_glue()
now works as intended -
Deprecated
FATAL()
,ERROR()
. Uselgr$fatal()
,lgr$error()
, ... instead.
-
Emergency fix that ensures test suite cleans up temporary files
-
Removed .rd file for the unexported LoggerRoot class
-
get_loggers()
registers new loggers in the lgr::loggers namespace, this is a more global and decoupled approach similar to how python logging handles loggers. -
removed
full_name
active binding for loggers. Loggers now only have qualified names andname
is now identical to whatfull_name
was before. For consistency the format method ofancestry
has also been revised. -
Logger inheritance is now derived from the qualified name of a logger. Consequently
lg$parent
is now derived fromlg$name
,lg$set_parent()
is no longer possible. -
If no threshold is set for a new Logger, it now inherits the threshold of its parent
-
Depend on R6 >= 2.4.0 which includes relevant fixes to finalizers. finalize methods are now private.
-
Logger now have a
config
method that allows configuring Loggers with config objects and YAML files (experimental) -
added
with_logging()
, the opposite ofwithout_logging()
. This can be handy for automated tests where you might want so switch logging off/on only for specific unit tests.
-
Added
show_data()
andshow_dt()
for quick access to the root loggers in memory log asdata.frame
ordata.table
respectively -
numerous small fixes
-
removed non-breaking-spaces from .RD files. This caused unforeseen problems with the compiling the .pdf manual during the CRAN submission process.