joblog: Joblog Objects

Description Usage Arguments Value Examples

Description

joblogs are data.tables with custom print() and summary() methods. as.joblog() just adds a joblog attribute to an appropriately formatted data.table. If you want to extract jobs from a normal log(file/data.frame) use scrape_joblog() instead.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
as_joblog(x)

## S3 method for class 'joblog'
print(x, ...)

## S3 method for class 'joblog'
summary(object, ...)

## S3 method for class 'joblog_summary'
print(x, ...)

Arguments

x, object

any R object

...

ignored

Value

summary.joblog() returns a joblog_summary data.table

summary.joblog() returns a joblog_summary data.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
lg <- lgr::get_logger("test")$
  set_propagate(FALSE)$
  add_appender(lgr::AppenderBuffer$new(), "buffer")

lg$list_log(job_start("update-database"))
lg$list_log(job_finished())
lg$list_log(job_start("send-report"))
lg$list_log(job_failed("something went wrong this time"))
res <- scrape_joblog(lg$appenders$buffer$data)

print(res)
summary(res)

lg$config(NULL)  # reset logger

s-fleck/joblog documentation built on Jan. 11, 2020, 11:04 a.m.