Learn R Programming

loggit2 (version 2.3.1)

Easy-to-Use, Dependencyless Logger

Description

An easy-to-use 'ndjson' (newline-delimited 'JSON') logger. It provides a set of wrappers for base R's message(), warning(), and stop() functions that maintain identical functionality, but also log the handler message to an 'ndjson' log file. No change in existing code is necessary to use this package, and only a few additional adjustments are needed to fully utilize its potential.

Copy Link

Version

Install

install.packages('loggit2')

Monthly Downloads

208

Version

2.3.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Matthias Ollech

Last Published

July 25th, 2024

Functions in loggit2 (2.3.1)

read_logs

Get log as data.frame
setup_timestamp_format

Set up the timestamp format for the application
rotate_logs

Rotate log file
setup_log_level

Set up the log level for the application
write_ndjson

Write ndJSON-formatted log file
setup_logfile

Set up the logfile for the application
split_ndjson

Convert a ndJSON object
stop

Stop Log Handler
stopifnot

Conditional Stop Log Handler
warning

Warning Log Handler
with_loggit

Log any expressions
setup_echo

Set up the echo for the application
set_timestamp_format

Set Timestamp Format
get_timestamp_format

Get Timestamp Format
convert_lvl_input

Convert Log Level Input to Integer
get_logfile

Get Log File
get_log_level

Get Log Level
set_log_level

Set Log Level
convert_to_csv

Write log to csv file
message

Message Log Handler
set_logfile

Set Log File
loggit

Log messages and R objects
get_echo

Get echo
get_lvl_name

Get Log Level Name
loggit_dots

Internal logging function for custom log fields
loggit_internal

Internal logging function
read_ndjson

Read ndJSON-formatted log file
find_call

Find the Call of a Parent Function in the Call Hierarchy
get_lvl_int

Get Log Level Integer
sanitizers

Sanitization for ndJSON.
set_echo

Set echo