showLog opens the log in the pager. For customization, see file.show. getLog returns the log as character vector.

showLog(id, reg = getDefaultRegistry())

getLog(id, reg = getDefaultRegistry())

Arguments

id

[integer(1) or data.table]
Single integer to specify the job or a data.table with column job.id and exactly one row.

reg

[Registry]
Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry).

Value

Nothing.

See also

Examples

tmp = makeRegistry(file.dir = NA, make.default = FALSE)
#> Sourcing configuration file '~/.batchtools.conf.R' ...
#> Created registry in '/tmp/batchtools-example/reg' using cluster functions 'Interactive'
# Create some dummy jobs fun = function(i) { if (i == 3) stop(i) if (i %% 2 == 1) warning("That's odd.") } ids = batchMap(fun, i = 1:5, reg = tmp)
#> Adding 5 jobs ...
submitJobs(reg = tmp)
#> Submitting 5 jobs in 5 chunks using cluster functions 'Interactive' ...
#> ### [bt]: Setting seed to 1 ...
#> Warning: That's odd.
#> ### [bt]: Setting seed to 2 ...
#> ### [bt]: Setting seed to 3 ...
#> ### [bt]: Setting seed to 4 ...
#> ### [bt]: Setting seed to 5 ...
#> Warning: That's odd.
waitForJobs(reg = tmp)
#> [1] FALSE
getStatus(reg = tmp)
#> Status for 5 jobs at 2018-05-20 00:31:42: #> Submitted : 5 (100.0%) #> -- Queued : 0 ( 0.0%) #> -- Started : 5 (100.0%) #> ---- Running : 0 ( 0.0%) #> ---- Done : 4 ( 80.0%) #> ---- Error : 1 ( 20.0%) #> ---- Expired : 0 ( 0.0%)
writeLines(getLog(ids[1], reg = tmp))
#> ### [bt]: This is batchtools v0.9.10 #> ### [bt]: Starting calculation of 1 jobs #> ### [bt]: Setting working directory to '/home/michel/Projekte/batchtools/docs/reference' #> ### [bt]: Memory measurement disabled #> ### [bt]: Starting job [batchtools job.id=1] #> #> ### [bt]: Job terminated successfully [batchtools job.id=1] #> ### [bt]: Calculation finished!
# NOT RUN { showLog(ids[1], reg = tmp) # }
grepLogs(pattern = "warning", ignore.case = TRUE, reg = tmp)
#> Key: <job.id> #> Empty data.table (0 rows) of 2 cols: job.id,matches