Fix date formatting in log

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7813 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-12-01 18:23:00 +00:00
parent b7c130b10b
commit 2be90a9672
2 changed files with 9 additions and 9 deletions

View File

@ -439,7 +439,7 @@ sub warning_message
if ( $log ) { if ( $log ) {
@localtime = localtime; @localtime = localtime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
} }
if ( $debug ) { if ( $debug ) {
@ -464,7 +464,7 @@ sub fatal_error {
if ( $log ) { if ( $log ) {
our @localtime = localtime; our @localtime = localtime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
if ( $debug ) { if ( $debug ) {
print $log longmess( " ERROR: @_$currentlineinfo\n" ); print $log longmess( " ERROR: @_$currentlineinfo\n" );
@ -485,7 +485,7 @@ sub fatal_error1 {
if ( $log ) { if ( $log ) {
our @localtime = localtime; our @localtime = localtime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
if ( $debug ) { if ( $debug ) {
print $log longmess( " ERROR: @_\n" ); print $log longmess( " ERROR: @_\n" );
@ -638,7 +638,7 @@ sub progress_message {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %2d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
my $line = "@_"; my $line = "@_";
$line =~ s/\s+/ /g; $line =~ s/\s+/ /g;
print $log "$line\n"; print $log "$line\n";
@ -661,7 +661,7 @@ sub progress_message2 {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n"; print $log "@_\n";
} }
} }
@ -682,7 +682,7 @@ sub progress_message3 {
@localtime = localtime unless $havelocaltime; @localtime = localtime unless $havelocaltime;
printf $log '%s %02d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0]; printf $log '%s %2d %02d:%02d:%02d ', $abbr[$localtime[4]], @localtime[3,2,1,0];
print $log "@_\n"; print $log "@_\n";
} }
} }

View File

@ -43,7 +43,7 @@ progress_message() # $* = Message
fi fi
if [ $LOG_VERBOSE -gt 1 ]; then if [ $LOG_VERBOSE -gt 1 ]; then
timestamp="$(date +'%_b %d %T') " timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG echo "${timestamp}$@" >> $STARTUP_LOG
fi fi
} }
@ -58,7 +58,7 @@ progress_message2() # $* = Message
fi fi
if [ $LOG_VERBOSE -gt 0 ]; then if [ $LOG_VERBOSE -gt 0 ]; then
timestamp="$(date +'%_b %d %T') " timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG echo "${timestamp}$@" >> $STARTUP_LOG
fi fi
} }
@ -73,7 +73,7 @@ progress_message3() # $* = Message
fi fi
if [ $LOG_VERBOSE -ge 0 ]; then if [ $LOG_VERBOSE -ge 0 ]; then
timestamp="$(date +'%_b %d %T') " timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG echo "${timestamp}$@" >> $STARTUP_LOG
fi fi
} }