Title: | Watch Logs Run |
---|---|
Description: | Watch a log, streaming progress to the console. |
Authors: | Rich FitzJohn [aut, cre], Imperial College of Science, Technology and Medicine [cph] |
Maintainer: | Rich FitzJohn <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2024-12-08 04:15:43 UTC |
Source: | https://github.com/reside-ic/logwatch |
Watch for a log of something.
logwatch( what, get_status, get_log, show_log = TRUE, skip = 0, show_spinner = TRUE, poll = 1, timeout = Inf, status_waiting = "waiting", status_running = "running", status_timeout = "timeout", status_interrupt = "interrupt", multiple = FALSE )
logwatch( what, get_status, get_log, show_log = TRUE, skip = 0, show_spinner = TRUE, poll = 1, timeout = Inf, status_waiting = "waiting", status_running = "running", status_timeout = "timeout", status_interrupt = "interrupt", multiple = FALSE )
what |
Very short summary of the process underlying the logs. Examples include "task", "installation", etc. |
get_status |
Function that will fetch a status. Accepts no
arguments, and returns one of a set of (by default) "waiting",
"running" or any status you like after that. When status is
"waiting" we show a spinner but do not stream logs. When
"running" we stream logs (but don't show a spinner). Any other
statement returns. You can change the expected "waiting" or
"running" status values with the |
get_log |
A callback to read logs of the installation
(something like |
show_log |
Logical, indicating if the installation log should be printed. |
skip |
Optional integer indicating how to handle log content
that exists at the point where we start watching. The default
(0) shows all log contents. A positive integer skips that many
lines, while a negative integer shows only that many lines (so
-5 shows the first five lines in the log). You can pass |
show_spinner |
Logical, indicating if a spinner should be
shown while waiting for the task to start, and if |
poll |
Time, in seconds, used to throttle calls to the status function. The default is 1 second |
timeout |
Timeout, in seconds, after which we give up. This
does not cancel the underlying process being watched! We return
|
status_waiting |
The value of a waiting status (can be a vector of possible statuses) |
status_running |
The value of a running status (can be a vector of possible statuses) |
status_timeout |
The value to return if we timeout |
status_interrupt |
The value to return if we are interrupted |
multiple |
Logical, indicating if |
A list with elements:
status: Your final status call
start: The start time
end: The end time