Allow for multiple args on log functions

This commit is contained in:
Franck Nijhof 2019-03-16 09:34:06 +01:00
parent 9ba69c749b
commit 2e04539422
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -14,7 +14,7 @@
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log() { bashio::log() {
local message=${1} local message=$*
echo -e "${message}" >&2 echo -e "${message}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -26,7 +26,7 @@ bashio::log() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.red() { bashio::log.red() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_RED}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_RED}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -38,7 +38,7 @@ bashio::log.red() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.green() { bashio::log.green() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_GREEN}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_GREEN}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -50,7 +50,7 @@ bashio::log.green() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.yellow() { bashio::log.yellow() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_YELLOW}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_YELLOW}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -62,7 +62,7 @@ bashio::log.yellow() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.blue() { bashio::log.blue() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_BLUE}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_BLUE}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -74,7 +74,7 @@ bashio::log.blue() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.magenta() { bashio::log.magenta() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_MAGENTA}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_MAGENTA}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }
@ -86,7 +86,7 @@ bashio::log.magenta() {
# $1 Message to display # $1 Message to display
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
bashio::log.cyan() { bashio::log.cyan() {
local message=${1} local message=$*
echo -e "${__BASHIO_COLORS_CYAN}${message}${__BASHIO_COLORS_RESET}" >&2 echo -e "${__BASHIO_COLORS_CYAN}${message}${__BASHIO_COLORS_RESET}" >&2
return "${__BASHIO_EXIT_OK}" return "${__BASHIO_EXIT_OK}"
} }