File: logging.R

package info (click to toggle)
r-cran-parallelmap 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: sh: 13; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# get all log dirs under storage dir
getLogDirs = function() {
  # FIXME why would someone restrict here to 999 maps?
  list.files(getPMOptStorageDir(), pattern = "parallelMap_logs_???", full.names = TRUE)
}

# delete all log dirs under storage dir
deleteAllLogDirs = function() {
  fns = getLogDirs()
  n = length(fns)
  if (n > 0L) {
    showInfoMessage("Deleting %i log dirs in storage dir.", n)
  }
}

getNextLogDir = function() {
  ld = file.path(getPMOptStorageDir(),
    sprintf("parallelMap_logs_%03i", getPMOptNextMap()))
  if (!file.exists(ld)) {
    dir.create(ld)
  }
  ld
}