mariobox
mariobox copied to clipboard
feat: log API version for run_api()
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__/