@@ -71,15 +71,16 @@ tcli_logger_infoscreenDone() {
7171# # @param string error message part 1 red color
7272# # @param string error message part 2 blue color
7373# # @param string error message part 3 red color
74+ # # @param string function or other notice in front of message
7475tcli_logger_infoscreenFailed () {
75- local _errormsg=" ${1:- } ${2:- } ${3:- } "
76+ local -a _errormsg
77+ # ="${1:-} ${2:-} ${3:-}"
78+ [ ${1:- } ] && _errormsg=($1 )
79+ [ ${2:- } ] && _errormsg+=($2 )
80+ [ ${3:- } ] && _errormsg+=($3 )
7681 [ ${TCLI_LOGGER_INFOSCREEN_WARN} == 1 ] && TCLI_LOGGER_INFOSCREEN_WARN=0
7782 printf " \r\033[1C${TCLI_LOGGER_RED} FAILED${TCLI_LOGGER_NC} \n"
78- # [ ${1:-} ] && printf "${TCLI_LOGGER_RED}${1}"
79- # [ ${2:-} ] && printf " ${TCLI_LOGGER_BLUE}${2}"
80- # [ ${3:-} ] && printf " ${TCLI_LOGGER_RED}${3}"
81- # printf "${TCLI_LOGGER_NC}\n"
82- [ ! -z " ${_errormsg:- } " ] && printf " ${_errormsg} " >&2
83+ tcli_logger_file_error $( echo ${_errormsg[@]} ) ${4:- }
8384}
8485
8586# # @fn tcli_logger_infoscreenFailedExit()
@@ -90,8 +91,14 @@ tcli_logger_infoscreenFailed() {
9091# # @param string error message part 2 blue color
9192# # @param string error message part 3 red color
9293# # @param interger exit code (default is 1)
94+ # # @param string error cause
9395tcli_logger_infoscreenFailedExit () {
94- tcli_logger_infoscreenFailed " ${1:- } " " ${2:- } " " ${3:- } "
96+ tcli_logger_infoscreenFailed " ${1:- } " " ${2:- } " " ${3:- } " " ${5:- } "
97+ [ ${4:- } ] && printf " ${TCLI_LOGGER_RED}${1} : "
98+ [ ${1:- } ] && printf " ${TCLI_LOGGER_RED}${1} "
99+ [ ${2:- } ] && printf " ${TCLI_LOGGER_BLUE}${2} "
100+ [ ${3:- } ] && printf " ${TCLI_LOGGER_RED}${3} "
101+ printf " ${TCLI_LOGGER_NC} \n"
95102 exit ${4:- 1}
96103}
97104
@@ -158,7 +165,7 @@ tcli_logger_title() {
158165# # @details
159166# # **Info to log file**
160167# # @param string message
161- # # @param string function or other notice before message
168+ # # @param string function or other notice in front of message
162169tcli_logger_file_info () {
163170 tcli_logger_file " Info" ${1:- } ${2:- }
164171}
0 commit comments