## TODO: Write header
## TODO: Add if 'DEBUG'
.log_memory_usage <- function(logger, retrieve = TRUE, when = NULL) {
  debug(logger, retrieve = retrieve, paste0(when, ":"))
  mem_info <- capture.output(memuse::Sys.meminfo())
  for (i in mem_info) {
    debug(recipe$Run$logger, retrieve = retrieve, i)
  }
  proc_mem <- capture.output(memuse::Sys.procmem())
  for (i in proc_mem) {
    debug(recipe$Run$logger, retrieve = retrieve, i)
  }
}
