log/simplify
This commit is contained in:
parent
449958091b
commit
54ab72488f
1 changed files with 3 additions and 13 deletions
|
@ -71,24 +71,14 @@ rwx_log_warn() {
|
|||
|
||||
# TODO simplify
|
||||
|
||||
_rwx_main_log() {
|
||||
[ ${#} -gt 0 ] || set -- ""
|
||||
local line
|
||||
for line in "${@}"; do
|
||||
echo "${line}"
|
||||
done
|
||||
}
|
||||
|
||||
_rwx_log() {
|
||||
local prefix="${1}"
|
||||
shift
|
||||
[ ${#} -gt 0 ] || set -- ""
|
||||
local line
|
||||
for line in "${@}"; do
|
||||
if [ -n "${prefix}" ]; then
|
||||
_rwx_main_log "${prefix} ${line}"
|
||||
else
|
||||
_rwx_main_log "${line}"
|
||||
fi
|
||||
[ -n "${prefix}" ] &&
|
||||
printf "%s" "${prefix} "
|
||||
echo "${line}"
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue