The log_write() function is not intended to be used directly, so it
should not be part of the public API of the log module.
This commit makes the log_write() function private by renaming it to
_log_write() and updating all references to it.
return 0
}
-log_write() {
+_log_write() {
local level="$1"
local prefix="$2"
done
else
while read -r line; do
- log_write "$level" "$prefix" "$line"
+ _log_write "$level" "$prefix" "$line"
done
fi
dbgtag="${BASH_SOURCE[1]}:${BASH_LINENO[1]} ${FUNCNAME[1]}:"
- log_write "$__log_debug" "[DBG] $dbgtag" "${lines[@]}"
+ _log_write "$__log_debug" "[DBG] $dbgtag" "${lines[@]}"
}
log_info() {
local lines=("$@")
- log_write "$__log_info" "[INF]" "${lines[@]}"
+ _log_write "$__log_info" "[INF]" "${lines[@]}"
}
log_warn() {
local lines=("$@")
- log_write "$__log_warning" "[WRN]" "${lines[@]}"
+ _log_write "$__log_warning" "[WRN]" "${lines[@]}"
}
log_error() {
local lines=("$@")
- log_write "$__log_error" "[ERR]" "${lines[@]}"
+ _log_write "$__log_error" "[ERR]" "${lines[@]}"
}