mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
🔨 Redirect all output from Bashio to stderr
This commit is contained in:
parent
24b2fee4f5
commit
01c49dcea6
2 changed files with 28 additions and 28 deletions
36
lib/color.sh
36
lib/color.sh
|
@ -11,124 +11,124 @@
|
||||||
# Reset color output (background and foreground colors).
|
# Reset color output (background and foreground colors).
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.reset() {
|
function bashio::color.reset() {
|
||||||
echo -n -e "${__BASHIO_COLORS_RESET}"
|
printf "${__BASHIO_COLORS_RESET}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set default output color.
|
# Set default output color.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.default() {
|
function bashio::color.default() {
|
||||||
echo -n -e "${__BASHIO_COLORS_DEFAULT}"
|
printf "${__BASHIO_COLORS_DEFAULT}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to black.
|
# Set font output color to black.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.black() {
|
function bashio::color.black() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BLACK}"
|
printf "${__BASHIO_COLORS_BLACK}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to red.
|
# Set font output color to red.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.red() {
|
function bashio::color.red() {
|
||||||
echo -n -e "${__BASHIO_COLORS_RED}"
|
printf "${__BASHIO_COLORS_RED}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to green.
|
# Set font output color to green.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.green() {
|
function bashio::color.green() {
|
||||||
echo -n -e "${__BASHIO_COLORS_GREEN}"
|
printf "${__BASHIO_COLORS_GREEN}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to yellow.
|
# Set font output color to yellow.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.yellow() {
|
function bashio::color.yellow() {
|
||||||
echo -n -e "${__BASHIO_COLORS_YELLOW}"
|
printf "${__BASHIO_COLORS_YELLOW}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to blue.
|
# Set font output color to blue.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.blue() {
|
function bashio::color.blue() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BLUE}"
|
printf "${__BASHIO_COLORS_BLUE}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to magenta.
|
# Set font output color to magenta.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.magenta() {
|
function bashio::color.magenta() {
|
||||||
echo -n -e "${__BASHIO_COLORS_MAGENTA}"
|
printf "${__BASHIO_COLORS_MAGENTA}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color to cyan.
|
# Set font output color to cyan.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.cyan() {
|
function bashio::color.cyan() {
|
||||||
echo -n -e "${__BASHIO_COLORS_CYAN}"
|
printf "${__BASHIO_COLORS_CYAN}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to default.
|
# Set font output color background to default.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.default() {
|
function bashio::color.bg.default() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_DEFAULT}"
|
printf "${__BASHIO_COLORS_BG_DEFAULT}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to black.
|
# Set font output color background to black.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.black() {
|
function bashio::color.bg.black() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_BLACK}"
|
printf "${__BASHIO_COLORS_BG_BLACK}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to red.
|
# Set font output color background to red.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.red() {
|
function bashio::color.bg.red() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_RED}"
|
printf "${__BASHIO_COLORS_BG_RED}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to green.
|
# Set font output color background to green.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.green() {
|
function bashio::color.bg.green() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_GREEN}"
|
printf "${__BASHIO_COLORS_BG_GREEN}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to yellow.
|
# Set font output color background to yellow.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.yellow() {
|
function bashio::color.bg.yellow() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_YELLOW}"
|
printf "${__BASHIO_COLORS_BG_YELLOW}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to blue.
|
# Set font output color background to blue.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.blue() {
|
function bashio::color.bg.blue() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_BLUE}"
|
printf "${__BASHIO_COLORS_BG_BLUE}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to magenta.
|
# Set font output color background to magenta.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.magenta() {
|
function bashio::color.bg.magenta() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_MAGENTA}"
|
printf "${__BASHIO_COLORS_BG_MAGENTA}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to cyan.
|
# Set font output color background to cyan.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.cyan() {
|
function bashio::color.bg.cyan() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_CYAN}"
|
printf "${__BASHIO_COLORS_BG_CYAN}" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Set font output color background to white.
|
# Set font output color background to white.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::color.bg.white() {
|
function bashio::color.bg.white() {
|
||||||
echo -n -e "${__BASHIO_COLORS_BG_WHITE}"
|
printf "${__BASHIO_COLORS_BG_WHITE}" >&2
|
||||||
}
|
}
|
||||||
|
|
20
lib/log.sh
20
lib/log.sh
|
@ -78,9 +78,9 @@ function bashio::log.debug() {
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::log.info() {
|
function bashio::log.info() {
|
||||||
local message=$*
|
local message=$*
|
||||||
bashio::color.cyan >&2
|
bashio::color.cyan
|
||||||
bashio::log.log "${__BASHIO_LOG_LEVEL_INFO}" "${message}"
|
bashio::log.log "${__BASHIO_LOG_LEVEL_INFO}" "${message}"
|
||||||
bashio::color.reset >&2
|
bashio::color.reset
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -91,9 +91,9 @@ function bashio::log.info() {
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::log.notice() {
|
function bashio::log.notice() {
|
||||||
local message=$*
|
local message=$*
|
||||||
bashio::color.blue >&2
|
bashio::color.blue
|
||||||
bashio::log.log "${__BASHIO_LOG_LEVEL_NOTICE}" "${message}"
|
bashio::log.log "${__BASHIO_LOG_LEVEL_NOTICE}" "${message}"
|
||||||
bashio::color.reset >&2
|
bashio::color.reset
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -104,9 +104,9 @@ function bashio::log.notice() {
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::log.warning() {
|
function bashio::log.warning() {
|
||||||
local message=$*
|
local message=$*
|
||||||
bashio::color.yellow >&2
|
bashio::color.yellow
|
||||||
bashio::log.log "${__BASHIO_LOG_LEVEL_WARNING}" "${message}"
|
bashio::log.log "${__BASHIO_LOG_LEVEL_WARNING}" "${message}"
|
||||||
bashio::color.reset >&2
|
bashio::color.reset
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -117,9 +117,9 @@ function bashio::log.warning() {
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::log.error() {
|
function bashio::log.error() {
|
||||||
local message=$*
|
local message=$*
|
||||||
bashio::color.magenta >&2
|
bashio::color.magenta
|
||||||
bashio::log.log "${__BASHIO_LOG_LEVEL_ERROR}" "${message}"
|
bashio::log.log "${__BASHIO_LOG_LEVEL_ERROR}" "${message}"
|
||||||
bashio::color.reset >&2
|
bashio::color.reset
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -130,7 +130,7 @@ function bashio::log.error() {
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::log.fatal() {
|
function bashio::log.fatal() {
|
||||||
local message=$*
|
local message=$*
|
||||||
bashio::color.red >&2
|
bashio::color.red
|
||||||
bashio::log.log "${__BASHIO_LOG_LEVEL_FATAL}" "${message}"
|
bashio::log.log "${__BASHIO_LOG_LEVEL_FATAL}" "${message}"
|
||||||
bashio::color.reset >&2
|
bashio::color.reset
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue