diff --git a/lib/functions/logging/display-alert.sh b/lib/functions/logging/display-alert.sh index 89bc7db07..8b4b91f43 100644 --- a/lib/functions/logging/display-alert.sh +++ b/lib/functions/logging/display-alert.sh @@ -15,7 +15,7 @@ function display_alert() { if [[ "${POOR_MAN_PROFILER}" == "yes" ]]; then poor_man_profiler fi - echo -e "${extra_profiler}${*}" | sed 's/\x1b\[[0-9;]*m//g' >&2 + echo -e "${extra_profiler}${3}::${1} ${2}" | sed 's/\x1b\[[0-9;]*m//g' >&2 return 0 fi diff --git a/lib/functions/logging/logging.sh b/lib/functions/logging/logging.sh index e017e0f3d..9e738b526 100644 --- a/lib/functions/logging/logging.sh +++ b/lib/functions/logging/logging.sh @@ -65,17 +65,19 @@ function logging_error_show_log() { echo "::endgroup::" fi - if [[ -f "${logfile_to_show}" ]]; then - local prefix_sed_contents="${normal_color}${left_marker}${padding}👉${padding}${right_marker} " - local prefix_sed_cmd="s/^/${prefix_sed_contents}/;" - CURRENT_LOGFILE="" display_alert " 👇👇👇 Showing logfile below 👇👇👇" "${logfile_to_show}" "err" + if [[ "${ANSI_COLOR}" != "none" ]]; then + if [[ -f "${logfile_to_show}" ]]; then + local prefix_sed_contents="${normal_color}${left_marker}${padding}👉${padding}${right_marker} " + local prefix_sed_cmd="s/^/${prefix_sed_contents}/;" + CURRENT_LOGFILE="" display_alert " 👇👇👇 Showing logfile below 👇👇👇" "${logfile_to_show}" "err" - # shellcheck disable=SC2002 # my cat is great. thank you, shellcheck. - cat "${logfile_to_show}" | grep -v -e "^$" | sed -e "${prefix_sed_cmd}" 1>&2 # write it to stderr!! + # shellcheck disable=SC2002 # my cat is great. thank you, shellcheck. + cat "${logfile_to_show}" | grep -v -e "^$" | sed -e "${prefix_sed_cmd}" 1>&2 # write it to stderr!! - CURRENT_LOGFILE="" display_alert " 👆👆👆 Showing logfile above 👆👆👆" "${logfile_to_show}" "err" - else - CURRENT_LOGFILE="" display_alert "✋ Error log not available at this stage of build" "check messages above" "debug" + CURRENT_LOGFILE="" display_alert " 👆👆👆 Showing logfile above 👆👆👆" "${logfile_to_show}" "err" + else + CURRENT_LOGFILE="" display_alert "✋ Error log not available at this stage of build" "check messages above" "debug" + fi fi return 0 }