1 |
Use verbose prefixes for output functions einfo, elog... in order to |
2 |
make the message types distinguishable on non-color terminals, |
3 |
and to enable the possibility of grepping them. The prefixes are |
4 |
roughly inspired by Xorg logs, and are: |
5 |
|
6 |
- `[--]` for einfo (and ebegin) |
7 |
- `[II]` for elog |
8 |
- `[WW]` for ewarn |
9 |
- `[QA]` for eqawarn |
10 |
- `[EE]` for eerror |
11 |
|
12 |
Signed-off-by: Michał Górny <mgorny@g.o> |
13 |
--- |
14 |
bin/isolated-functions.sh | 12 ++++++------ |
15 |
lib/portage/output.py | 12 ++++++------ |
16 |
2 files changed, 12 insertions(+), 12 deletions(-) |
17 |
|
18 |
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh |
19 |
index df806d403..c7fda6784 100644 |
20 |
--- a/bin/isolated-functions.sh |
21 |
+++ b/bin/isolated-functions.sh |
22 |
@@ -270,7 +270,7 @@ eqawarn() { |
23 |
__elog_base QA "$*" |
24 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
25 |
echo -e "$@" | while read -r ; do |
26 |
- echo " ${PORTAGE_COLOR_QAWARN}*${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
27 |
+ echo "${PORTAGE_COLOR_QAWARN}[QA]${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
28 |
done |
29 |
LAST_E_CMD="eqawarn" |
30 |
return 0 |
31 |
@@ -280,7 +280,7 @@ elog() { |
32 |
__elog_base LOG "$*" |
33 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
34 |
echo -e "$@" | while read -r ; do |
35 |
- echo " ${PORTAGE_COLOR_LOG}*${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
36 |
+ echo "${PORTAGE_COLOR_LOG}[II]${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
37 |
done |
38 |
LAST_E_CMD="elog" |
39 |
return 0 |
40 |
@@ -290,7 +290,7 @@ einfo() { |
41 |
__elog_base INFO "$*" |
42 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
43 |
echo -e "$@" | while read -r ; do |
44 |
- echo " ${PORTAGE_COLOR_INFO}*${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
45 |
+ echo "${PORTAGE_COLOR_INFO}[--]${PORTAGE_COLOR_NORMAL} ${REPLY}" >&2 |
46 |
done |
47 |
LAST_E_CMD="einfo" |
48 |
return 0 |
49 |
@@ -299,7 +299,7 @@ einfo() { |
50 |
einfon() { |
51 |
__elog_base INFO "$*" |
52 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
53 |
- echo -ne " ${PORTAGE_COLOR_INFO}*${PORTAGE_COLOR_NORMAL} $*" >&2 |
54 |
+ echo -ne "${PORTAGE_COLOR_INFO}[--]${PORTAGE_COLOR_NORMAL} $*" >&2 |
55 |
LAST_E_CMD="einfon" |
56 |
return 0 |
57 |
} |
58 |
@@ -308,7 +308,7 @@ ewarn() { |
59 |
__elog_base WARN "$*" |
60 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
61 |
echo -e "$@" | while read -r ; do |
62 |
- echo " ${PORTAGE_COLOR_WARN}*${PORTAGE_COLOR_NORMAL} ${RC_INDENTATION}${REPLY}" >&2 |
63 |
+ echo "${PORTAGE_COLOR_WARN}[WW]${PORTAGE_COLOR_NORMAL} ${RC_INDENTATION}${REPLY}" >&2 |
64 |
done |
65 |
LAST_E_CMD="ewarn" |
66 |
return 0 |
67 |
@@ -318,7 +318,7 @@ eerror() { |
68 |
__elog_base ERROR "$*" |
69 |
[[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo >&2 |
70 |
echo -e "$@" | while read -r ; do |
71 |
- echo " ${PORTAGE_COLOR_ERR}*${PORTAGE_COLOR_NORMAL} ${RC_INDENTATION}${REPLY}" >&2 |
72 |
+ echo "${PORTAGE_COLOR_ERR}[EE]${PORTAGE_COLOR_NORMAL} ${RC_INDENTATION}${REPLY}" >&2 |
73 |
done |
74 |
LAST_E_CMD="eerror" |
75 |
return 0 |
76 |
diff --git a/lib/portage/output.py b/lib/portage/output.py |
77 |
index 42f487f8a..deae207fc 100644 |
78 |
--- a/lib/portage/output.py |
79 |
+++ b/lib/portage/output.py |
80 |
@@ -680,7 +680,7 @@ class EOutput: |
81 |
if not self.quiet: |
82 |
if self.__last_e_cmd == "ebegin": |
83 |
self._write(out, "\n") |
84 |
- self._write(out, colorize("ERR", " * ") + msg + "\n") |
85 |
+ self._write(out, colorize("ERR", "[EE] ") + msg + "\n") |
86 |
self.__last_e_cmd = "eerror" |
87 |
|
88 |
def einfo(self, msg): |
89 |
@@ -694,7 +694,7 @@ class EOutput: |
90 |
if not self.quiet: |
91 |
if self.__last_e_cmd == "ebegin": |
92 |
self._write(out, "\n") |
93 |
- self._write(out, colorize("INFO", " * ") + msg + "\n") |
94 |
+ self._write(out, colorize("INFO", "[--] ") + msg + "\n") |
95 |
self.__last_e_cmd = "einfo" |
96 |
|
97 |
def einfon(self, msg): |
98 |
@@ -708,7 +708,7 @@ class EOutput: |
99 |
if not self.quiet: |
100 |
if self.__last_e_cmd == "ebegin": |
101 |
self._write(out, "\n") |
102 |
- self._write(out, colorize("INFO", " * ") + msg) |
103 |
+ self._write(out, colorize("INFO", "[--] ") + msg) |
104 |
self.__last_e_cmd = "einfon" |
105 |
|
106 |
def eqawarn(self, msg): |
107 |
@@ -722,7 +722,7 @@ class EOutput: |
108 |
if not self.quiet: |
109 |
if self.__last_e_cmd == "ebegin": |
110 |
self._write(out, "\n") |
111 |
- self._write(out, colorize("QAWARN", " * ") + msg + "\n") |
112 |
+ self._write(out, colorize("QAWARN", "[QA] ") + msg + "\n") |
113 |
self.__last_e_cmd = "ewarn" |
114 |
|
115 |
def elog(self, msg): |
116 |
@@ -736,7 +736,7 @@ class EOutput: |
117 |
if not self.quiet: |
118 |
if self.__last_e_cmd == "ebegin": |
119 |
self._write(out, "\n") |
120 |
- self._write(out, colorize("LOG", " * ") + msg + "\n") |
121 |
+ self._write(out, colorize("LOG", "[II] ") + msg + "\n") |
122 |
self.__last_e_cmd = "elog" |
123 |
|
124 |
def ewarn(self, msg): |
125 |
@@ -750,7 +750,7 @@ class EOutput: |
126 |
if not self.quiet: |
127 |
if self.__last_e_cmd == "ebegin": |
128 |
self._write(out, "\n") |
129 |
- self._write(out, colorize("WARN", " * ") + msg + "\n") |
130 |
+ self._write(out, colorize("WARN", "[WW] ") + msg + "\n") |
131 |
self.__last_e_cmd = "ewarn" |
132 |
|
133 |
def ewend(self, errno, *msg): |
134 |
-- |
135 |
2.33.0 |