Learn R Programming

loggit (version 2.1.1)

Modern Logging for the R Ecosystem

Description

An effortless 'ndjson' (newline-delimited 'JSON') logger, with two primary log-writing interfaces. It provides a set of wrappings for base R's message(), warning(), and stop() functions that maintain identical functionality, but also log the handler message to an 'ndjson' log file. 'loggit' also exports its internal 'loggit()' function for powerful and configurable custom logging. No change in existing code is necessary to use this package, and should only require additions to fully leverage the power of the logging system. 'loggit' also provides a log reader for reading an 'ndjson' log file into a data frame, log rotation, and live echo of the 'ndjson' log messages to terminal 'stdout' for log capture by external systems (like containers). 'loggit' is ideal for Shiny apps, data pipelines, modeling work flows, and more. Please see the vignettes for detailed example use cases.

Copy Link

Version

Install

install.packages('loggit')

Monthly Downloads

547

Version

2.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ryan Price

Last Published

February 28th, 2021

Functions in loggit (2.1.1)

handlers

loggit's Exception Handlers
read_logs

Return log file as an R data frame
loggit

Log entries to file
read_ndjson

Read ndJSON-formatted log file
set_logfile

Set Log File
set_timestamp_format

Set Timestamp Format
get_timestamp_format

Get Timestamp Format
get_logfile

Get Log File
sanitizers

Default sanitization for ndJSON.
rotate_logs

Rotate log file
write_ndjson

Write ndJSON-formatted log file