Skip to contents

The function splits the log entries into blocks based on time gaps between timestamps. The threshold for splitting can be provided or calculated based on the gaps in the log timestamps.

Usage

seasonder_splitLog(
  threshold = NULL,
  threshold_factor = 4,
  threshold_quantile = 0.9,
  min_threshold_secs = 10
)

Arguments

threshold

The time difference threshold for splitting the logs. If NULL, it's calculated.

threshold_factor

Multiplicative factor applied to the calculated threshold.

threshold_quantile

Quantile used for threshold calculation if threshold is NULL.

min_threshold_secs

Minimum threshold in seconds.

Value

A list of log blocks, each block being a vector of log entries.

Examples

# Enable logging
seasonder_enableLogs()
# Log some messages
seasonder_log("First log entry", "info")
Sys.sleep(0.1)
seasonder_log("Second log entry", "info")
# Split logs into blocks (using a 1-second threshold)
blocks <- seasonder_splitLog(threshold = as.difftime(300, units = "secs"))
str(blocks)
#> List of 1
#>  $ : chr [1:285] "[INFO] 2025-04-28 09:33:06.48432: seasonder_createSeaSondeRAPM:  APM object created successfully." "[INFO] 2025-04-28 09:33:11.660984: seasonder_createSeaSondeRAPM:  APM object created successfully." "[INFO] 2025-04-28 09:33:11.876783: new_SeaSondeRCS:  SeaSondeRCS object created successfully." "[INFO] 2025-04-28 09:33:11.891998: seasonder_runMUSIC:  MUSIC algorithm started." ...