logging: Logging

Description Usage Arguments Details

Description

Log to the rAutomate Logging System

Usage

1
2
3
4
5
6
7
cronLog(msg, level = "info", app = getOption("crontabRjobValues")$name)

logErrors(expr)

getLog(levels, jobs, start_date, end_date)

setCronjobValues(name, desc, logLevel = "info", textLevel = "none")

Arguments

msg

The message to log

level

The loglevel to log to

app

The app to which to associate the log entry

expr

an expression to be evaluated with crontabR logging.

levels

A list of logging levels to return from the log

jobs

A list of cronjob names to return from the log

start_date

The earliest date for which to return log entries

end_date

The latest date for which to return log entries

name

The name of the currently active script

desc

The description of the currently active script

Details

crontabR contains a logging system that will automatically log most errors and warnings to a log file saved in ~/.crontabR/logs/log. In addition, you may use the cronLog function to log additional information to the log. The log can be one of six different levels; error, warn, info, verbose, debug, or silly.

logErrors isn't meant to be used by users. Each script that is automated with crontabR is wrapped in this function so that errors, warnings, and messages are automatically logged. Errors are logged at level error, warnings are logged at level warn, and messages are logged at level verbose. In addition, any value the script returns will be logged at level info.

getLog reads and optionally filters the crontabR log.

setCronjobValues and clearCronjobValues are automatically added to scripts processed by crontabR so that the loggin system will be able to assign the correct name to the log entries. There shouldn't be any need for a user to use these functions.


ebailey78/crontabR documentation built on June 5, 2019, 7:27 a.m.