The warn function was putting content into a side log file which made
it kind of hard to keep an eye on when warnings were actually being
issued. Let's just get this into the main output stream.
The calling of the warn function in git_timed was also incorrect, so
the output would not have been what we expected. This solves that as
well.
This will hopefully give us trackable data about how often we need to
recover from git clone errors.
Change-Id: Iee0d2df7fb788a4d34044d29ab10afdcafb9bb5a
... | ... |
@@ -174,10 +174,7 @@ function warn { |
174 | 174 |
local xtrace=$(set +o | grep xtrace) |
175 | 175 |
set +o xtrace |
176 | 176 |
local msg="[WARNING] ${BASH_SOURCE[2]}:$1 $2" |
177 |
- echo $msg 1>&2; |
|
178 |
- if [[ -n ${LOGDIR} ]]; then |
|
179 |
- echo $msg >> "${LOGDIR}/error.log" |
|
180 |
- fi |
|
177 |
+ echo $msg |
|
181 | 178 |
$xtrace |
182 | 179 |
return $exitcode |
183 | 180 |
} |
... | ... |
@@ -509,7 +506,7 @@ function git_timed { |
509 | 509 |
fi |
510 | 510 |
|
511 | 511 |
count=$(($count + 1)) |
512 |
- warn "timeout ${count} for git call: [git $@]" |
|
512 |
+ warn $LINENO "timeout ${count} for git call: [git $@]" |
|
513 | 513 |
if [ $count -eq 3 ]; then |
514 | 514 |
die $LINENO "Maximum of 3 git retries reached" |
515 | 515 |
fi |