mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
logging: better logging when ANSI_COLOR=none (eg, during info collection)
This commit is contained in:
@@ -15,7 +15,7 @@ function display_alert() {
|
|||||||
if [[ "${POOR_MAN_PROFILER}" == "yes" ]]; then
|
if [[ "${POOR_MAN_PROFILER}" == "yes" ]]; then
|
||||||
poor_man_profiler
|
poor_man_profiler
|
||||||
fi
|
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
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -65,17 +65,19 @@ function logging_error_show_log() {
|
|||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "${logfile_to_show}" ]]; then
|
if [[ "${ANSI_COLOR}" != "none" ]]; then
|
||||||
local prefix_sed_contents="${normal_color}${left_marker}${padding}👉${padding}${right_marker} "
|
if [[ -f "${logfile_to_show}" ]]; then
|
||||||
local prefix_sed_cmd="s/^/${prefix_sed_contents}/;"
|
local prefix_sed_contents="${normal_color}${left_marker}${padding}👉${padding}${right_marker} "
|
||||||
CURRENT_LOGFILE="" display_alert " 👇👇👇 Showing logfile below 👇👇👇" "${logfile_to_show}" "err"
|
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.
|
# 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!!
|
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"
|
CURRENT_LOGFILE="" display_alert " 👆👆👆 Showing logfile above 👆👆👆" "${logfile_to_show}" "err"
|
||||||
else
|
else
|
||||||
CURRENT_LOGFILE="" display_alert "✋ Error log not available at this stage of build" "check messages above" "debug"
|
CURRENT_LOGFILE="" display_alert "✋ Error log not available at this stage of build" "check messages above" "debug"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user