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)

Arguments

...

Objects that are evaluated, coerced into character string, collapsed and pasted into log entry body (or header if name is NULL).

name

A character string. The name of the event.

type

A character string. A type of the event. Default for log_started is "EVENT". The type logged with log_done is the same as the type of the event logged with log_started.

status

A character string. A status of the event. Default for log_started is "STARTED". The status is always "DONE" when using log_done.

params

A list of additional named event-specific parameters. Default is NULL.

Functions

  • log_started: Logging the start of an event

  • log_done: Logging the end of an event

See also

Other logging events functions: log_event, log_message, log_output, log_test, log_value

Examples

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") } ) }