R/show_server_status_messages.R

Defines functions show_server_status_messages

show_server_status_messages <- function(out) {


  show_message <- function(msg_type, msg_Title, msg_color) {
    ba_message(msg_color(paste0("\n", msg_Title,":")))
    sapply(out[names(out) == msg_type] %>% unlist, msg_color) %>%
      as.character %>%
      paste0("\n") %>%
      ba_message()
  }

  if(!getOption("brapi_info", default = FALSE)) return()

  # if(!is.null(out$metadata)) {
  #   out <- out$metadata$status %>% unlist %>% as.list()
  #   ba_message(crayon::yellow("Status details from Server:"))
  #
  #   show_message("info", "Infos", crayon::blue)
  #   show_message("success", "Successes", crayon::green)
  #   show_message("error", "Errors", crayon::red)
  #
  # }

}
c5sire/brapi documentation built on Oct. 17, 2019, 11:45 a.m.