batchtools (version 0.9.17)

showLog: Inspect Log Files

Description

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

Usage

showLog(id, reg = getDefaultRegistry())

getLog(id, reg = getDefaultRegistry())

Value

Nothing.

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).

See Also

Other debug: getErrorMessages(), getStatus(), grepLogs(), killJobs(), resetJobs(), testJob()

Examples

Run this code
 batchtools:::example_push_temp(1) 
tmp = makeRegistry(file.dir = NA, make.default = FALSE)

# 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)
submitJobs(reg = tmp)
waitForJobs(reg = tmp)
getStatus(reg = tmp)

writeLines(getLog(ids[1], reg = tmp))
if (FALSE) {
showLog(ids[1], reg = tmp)
}

grepLogs(pattern = "warning", ignore.case = TRUE, reg = tmp)

Run the code above in your browser using DataLab