Skip to content

Commit

Permalink
fix: debug logging logic and format (#592)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster authored Nov 20, 2023
1 parent 2a59b1d commit 3c7e5be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/zsdoc/zinit-install.zsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ____
____

Has 87 line(s). Calls functions:
Has 89 line(s). Calls functions:

.zinit-compile-plugin
|-- zinit-side.zsh/.zinit-compute-ice
Expand Down
2 changes: 1 addition & 1 deletion doc/zsdoc/zinit.zsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ PRECMD-HOOK @zinit-scheduler

==== Script Body

Has 244 line(s). Calls functions:
Has 245 line(s). Calls functions:

Script-Body
|-- +zi-log
Expand Down
4 changes: 3 additions & 1 deletion zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {

# when from"gh-r" ice set, skip compile unless compile ice is set
if [[ ${ICE[from]} = gh-r ]] && (( ${+ICE[compile]} == 0 )); then
+zi-log '{d} from"gh-r" detected, skipping compile'
+zi-log '{dbg} from"gh-r" detected, skipping compile'
return 0
fi

Expand Down Expand Up @@ -905,6 +905,8 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
+zi-log -n "{m} {num}${#list}{rst} compiled file${=${list:#1}:+s} added to {var}\$ADD_COMPILED{rst} array"
if (( retval )) {
+zi-log " (exit code: {ehi}$retval{rst})"
} else {
+zi-log ' '
}
}
fi
Expand Down
3 changes: 2 additions & 1 deletion zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ if [[ -z $SOURCED && ( ${+terminfo} -eq 1 && -n ${terminfo[colors]} ) || ( ${+te

col-i $'\e[1m\e[38;5;82m'"==>"$'\e[0m' col-e $'\e[1m\e[38;5;204m'"Error: "$'\e[0m'
col-m $'\e[1m\e[38;5;135m'"==>"$'\e[0m' col-w $'\e[1;38;5;214m'"Warning: "$'\e[0m'
col-dbg $'\e[2m\e[38;47;108m'"[debug]"$'\e[0m'

col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-ndsh "${${${(M)LANG:#*UTF-8*}:+–}:-}" col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}"
Expand Down Expand Up @@ -1977,7 +1978,7 @@ builtin setopt noaliases
builtin emulate -L zsh -o extendedglob
REPLY=
if (( ZINIT[DEBUG] )); then
REPLY=$1
REPLY="$ZINIT[col-dbg]$1"
fi
} # ]]]

Expand Down

0 comments on commit 3c7e5be

Please sign in to comment.