Add a timestamp to the log output for better diagnosis

when we are looking at logs generated by the gate jobs
we need timestamps on the output of stack.sh so we can
figure out what was being executed around the time when
there was a problem in say nova-network

Change-Id: I203e8dae97715d6ee46a4088c7577b9be66cf09d
This commit is contained in:
Davanum Srinivas 2012-12-06 09:47:53 -05:00
parent 9b243b32cc
commit e5eee5834b

View File

@ -598,7 +598,15 @@ if [[ -n "$LOGFILE" ]]; then
exec 3>&1
if [[ "$VERBOSE" == "True" ]]; then
# Redirect stdout/stderr to tee to write the log file
exec 1> >( tee "${LOGFILE}" ) 2>&1
exec 1> >( awk '
{
cmd ="date +\"%Y-%m-%d %H:%M:%S \""
cmd | getline now
close("date +\"%Y-%m-%d %H:%M:%S \"")
sub(/^/, now)
print
fflush()
}' | tee "${LOGFILE}" ) 2>&1
# Set up a second fd for output
exec 6> >( tee "${SUMFILE}" )
else