armbian-next: hopefully improved error logging; avoid logging errors up to 3x; subdued red stacktraces

- reorg `display_alert()` so more frequent levels are handled first
- improve some ANSI color usage, still a mess
- don't write failed commands stackstrace as warnings to screen -- just to file (yes it's redundant, except if in test)
- more useful / subdued stacktraces, to make actual error more obvious...
This commit is contained in:
Ricardo Pardini
2023-01-18 22:43:25 +01:00
parent da1cf2b475
commit 8cedc82ec2
6 changed files with 74 additions and 58 deletions

View File

@@ -15,6 +15,9 @@ function logging_init() {
# globals
declare -g padding="" left_marker="[" right_marker="]"
declare -g normal_color="\x1B[0m" gray_color="\e[1;30m" # "bright black", which is grey
declare -g bright_red_color="\e[1;31m" red_color="\e[0;31m"
declare -g bright_blue_color="\e[1;34m" blue_color="\e[0;34m"
declare -g bright_magenta_color="\e[1;35m" magenta_color="\e[0;35m"
declare -g -i logging_section_counter=0 # -i: integer
declare -g tool_color="${gray_color}" # default to gray... (should be ok on terminals, @TODO: I've seen it too dark on a few random screenshots though
if [[ "${CI}" == "true" ]]; then # ... but that is too dark for Github Actions