fix basename, when -bash is shell
This commit is contained in:
parent
8cd1000cd5
commit
4047123683
1 changed files with 2 additions and 2 deletions
4
logging
4
logging
|
@ -14,7 +14,7 @@ for level in SCRIPTENTRY SCRIPTEXIT ENTRY EXIT; do
|
|||
echo "[%s] »${BASH_SOURCE[0]##*/} (${FUNCNAME[1]}) « ######################################################" >&2
|
||||
fi
|
||||
if [[ ! ${loglevels[*]} =~ "${FILELOGLEVEL:-$FILELOGLEVEL_DEFAULT}" ]];then
|
||||
echo "[${timeAndDate}] [%s] $(basename $0) (${FUNCNAME[1]})" >> "${SCRIPT_LOG}"
|
||||
echo "[${timeAndDate}] [%s] $(basename -- $0) (${FUNCNAME[1]})" >> "${SCRIPT_LOG}"
|
||||
fi }' "${level}" "${level^^}" "${level^^}"
|
||||
eval "$functext"
|
||||
export -f "${level}"
|
||||
|
@ -33,7 +33,7 @@ for level in ${loglevels[@]}; do
|
|||
printf "[%%s] (%%s) %%s\n" %s "${FUNCNAME[1]}" "${msg}" >&2
|
||||
fi
|
||||
if [[ ! ${loglevels[*]} =~ "${FILELOGLEVEL:-$FILELOGLEVEL_DEFAULT}" ]];then
|
||||
printf "[%%s] [%%s] %%s (%%s) %%s\n" "$timeAndDate" %s "$(basename $0)" "${FUNCNAME[1]}" "${msg}" >> "${SCRIPT_LOG}"
|
||||
printf "[%%s] [%%s] %%s (%%s) %%s\n" "$timeAndDate" %s "$(basename -- $0)" "${FUNCNAME[1]}" "${msg}" >> "${SCRIPT_LOG}"
|
||||
fi }' "$level" "$(echo ${loglevels[@]})" "${level^^}" "${level^^}"
|
||||
eval "$functext"
|
||||
export -f "log${level}"
|
||||
|
|
Loading…
Reference in a new issue