Description Usage Arguments Value Side effects Database setup Fatal errors Note See Also
Complete logging solution. Writes to database expressions metadata before its evaluation. Evalutes with timing and warning/error/interrupt/messages catching. Updates database entry for processing details: in/out rows, custom metadata, messages/warning/error message. Email on alerts.
1 2 3 4 5 6 | logR(expr, lazy = TRUE, parent = getOption("logR.id", NA_integer_),
alert = TRUE, in_rows = NA_integer_, meta = getOption("logR.meta"),
silent = getOption("logR.silent"), mail = getOption("logR.mail"),
mail_args = getOption("logR.mail_args"), boolean = FALSE,
.conn = getOption("logR.conn"), .schema = getOption("logR.schema"),
.table = getOption("logR.table"), .log = getOption("logR.log"))
|
expr |
expression to be evaluted with logging. |
lazy |
logical default TRUE, use FALSE when passing language object to expr argument. |
parent |
integer default NA, the 'logr_id' of the parent logged process. |
alert |
logical, should be alert flag suppressed on warning/error, including suppressing email notification. |
in_rows |
integer input DF/DT nrow, logR can only guess out_rows. |
meta |
list or a function that will result such list, list of custom fields, each of length 1, list be always the same, fill missing with NA. Default |
silent |
logical, if default |
mail |
logical if TRUE then on alert the email will be send. Requires mail_args to be provided. Default |
mail_args |
list - mail not implemented yet. |
boolean |
logical, default FALSE, when TRUE only 'status=="success"' will be returned. |
.conn |
DBI connection. Default to |
.schema |
character scalar, location in database to store logs, default |
.table |
character scalar, location in database to store logs, default |
.log |
logical escape parameter, set to FALSE to suppress logR process and just execute a call, default to |
Result of evaluated expr, NULL in case of error or interrupt. If silent = FALSE
then error/warning/interrupt will raise warning/error.
entry in database table.
in case of alerts and email notification configured also the email will be send.
You can create db objects automatically using logR_schema function or manually using code from schema_sql.
If your R function will manage to kill whole R session you will see that status entry in log table will not get updated and it will stay as NA. It might be worth to schedule a watcher task to detect such cases, see logR_watcher.
Only first warning/message will be logged to database and send on email.
logR_schema, logR_query
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.