mariobox icon indicating copy to clipboard operation
mariobox copied to clipboard

feat: log API version for run_api()

Open psolymos opened this issue 3 years ago • 0 comments

Log the API package version when Plumber is started, e.g.:

run_api <- function() {
  ver <- read.dcf(
    file = system.file("DESCRIPTION", package = "test"),
    fields = "Version"
  )
  mariobox::mario_log(
    method = paste("Starting", "test"),
    name = ver
  )
  mariobox::new_api(
    yaml_file = system.file(
      "mariobox.yml",
      package = "test"
    )
  )$run()
}

This gives:

run_api()
── [2022-09-27 21:46:55] Starting test - 0.0.0.9000 ───────────────────────────────────────────────────────────────────────────────
Running plumber API at http://127.0.0.1:15172
Running swagger Docs at http://127.0.0.1:15172/__docs__/

psolymos avatar Sep 28 '22 03:09 psolymos