From a14a8b2739aa37958e9b536c90d78181e2a3819e Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 9 Oct 2009 15:44:57 -0700 Subject: [PATCH] change date format in logs - was missing slash between month and day R=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=35526 CL=35540 --- src/pkg/log/log.go | 2 +- src/pkg/log/log_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/log/log.go b/src/pkg/log/log.go index 80c72a6bcb9..22101667449 100644 --- a/src/pkg/log/log.go +++ b/src/pkg/log/log.go @@ -86,7 +86,7 @@ func (l *Logger) formatHeader(ns int64, calldepth int) string { if l.flag & (Ldate | Ltime | Lmicroseconds) != 0 { t := time.SecondsToLocalTime(ns/1e9); if l.flag & (Ldate) != 0 { - h += itoa(int(t.Year), 4) + "/" + itoa(t.Month, 2) + itoa(t.Day, 2) + " "; + h += itoa(int(t.Year), 4) + "/" + itoa(t.Month, 2) + "/" + itoa(t.Day, 2) + " "; } if l.flag & (Ltime | Lmicroseconds) != 0 { h += itoa(t.Hour, 2) + ":" + itoa(t.Minute, 2) + ":" + itoa(t.Second, 2); diff --git a/src/pkg/log/log_test.go b/src/pkg/log/log_test.go index 9c28405dc76..f26ce4087ed 100644 --- a/src/pkg/log/log_test.go +++ b/src/pkg/log/log_test.go @@ -14,7 +14,7 @@ import ( ) const ( - Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9][0-9][0-9]`; + Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`; Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`; Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`; Rline = `[0-9]+:`;