log_started
logs an event with status "STARTED"
.
log_done
logs the same event with status "DONE"
.
Difference between timestamps of these two log entries can be used
for timing an event. One event can have several instances with
different statuses.
When logging instances of the same event, event name
or, if name = NULL
, objects passed to ...
must be exactly the same, as they are used to create unique event id.
Started events, their types and counters are registered
in an environment called log_event_register
,
which enables creating and timing multiple nested events.
log_started(..., name = NULL, type = "EVENT", status = "STARTED", params = NULL) log_done(..., name = NULL, params = NULL)
... | Objects that are evaluated, coerced into character string,
collapsed and pasted into log entry body
(or header if |
---|---|
name | A character string. The name of the event. |
type | A character string. A type of the event.
Default for |
status | A character string. A status of the event.
Default for |
params | A list of additional named event-specific parameters.
Default is |
log_started
: Logging the start of an event
log_done
: Logging the end of an event
Other logging events functions: log_event
,
log_message
, log_output
,
log_test
, log_value
if (interactive()) { set_logging() shiny::shinyApp( ui = shiny::fluidPage(log_init()), server = function(input, output) { set_logging_session() log_started(as.character(Sys.time()), name = "Event 1") Sys.sleep(0.5) log_started(as.character(Sys.time()), name = "Event 2") log_event(as.character(Sys.time()), name = "Event 3") Sys.sleep(0.5) log_done(as.character(Sys.time()), name = "Event 2") log_done(as.character(Sys.time()), name = "Event 1") } ) }