Learn R Programming

loggit2 (version 2.4.0)

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

156

Version

2.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Matthias Ollech

Last Published

June 1st, 2025

Functions in loggit2 (2.4.0)

set_log_level

Set Log Level
read_logs

Get log as data.frame
get_lvl_int

Get Log Level Integer
get_lvl_name

Get Log Level Name
set_call_options

Set Call Options
set_echo

Set echo
with_loggit

Log any expressions
warning

Warning Log Handler
stopifnot

Conditional Stop Log Handler
setup_log_level

Set up the log level for the application
write_ndjson

Write ndJSON-formatted log file
setup_call_options

Set up the call options for the application
setup_echo

Set up the echo for the application
read_ndjson

Read ndJSON-formatted log file
stop

Stop Log Handler
set_timestamp_format

Set Timestamp Format
set_logfile

Set Log File
setup_logfile

Set up the logfile for the application
split_ndjson

Convert a ndJSON object
setup_timestamp_format

Set up the timestamp format for the application
get_log_level

Get Log Level
call_2_string

Convert Call to String
get_echo

Get echo
get_call_options

Get Call Options
convert_to_csv

Write log to csv file
get_logfile

Get Log File
debuginfo

Debug Log Handler
get_timestamp_format

Get Timestamp Format
message

Message Log Handler
loggit

Log messages and R objects
find_call

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

Get package name
get_file_loc

Get file location
loggit_internal

Internal logging function
convert_lvl_input

Convert Log Level Input to Integer
loggit_dots

Internal logging function for custom log fields
rotate_logs

Rotate log file
sanitizers

Sanitization for ndJSON.