diff options
Diffstat (limited to 'lib/textui')
-rw-r--r-- | lib/textui/log.go | 3 | ||||
-rw-r--r-- | lib/textui/log_test.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/textui/log.go b/lib/textui/log.go index 8327b67..110e1aa 100644 --- a/lib/textui/log.go +++ b/lib/textui/log.go @@ -180,7 +180,7 @@ func (l *logger) log(lvl dlog.LogLevel, writeMsg func(io.Writer)) { // time //////////////////////////////////////////////////////////////// now := time.Now() - const timeFmt = "2006-01-02 15:04:05.0000" + const timeFmt = "15:04:05.0000" logBuf.WriteString(timeFmt) now.AppendFormat(logBuf.Bytes()[:0], timeFmt) @@ -372,6 +372,7 @@ func writeField(w io.Writer, key string, val any) { if strings.HasPrefix(valStr, "/main/") { valStr = strings.TrimPrefix(valStr, "/main") } + valStr = strings.TrimPrefix(valStr, "/") } case strings.HasSuffix(name, ".pass"): fmt.Fprintf(w, "/pass-%s", valStr) diff --git a/lib/textui/log_test.go b/lib/textui/log_test.go index 514d96e..bcd9c39 100644 --- a/lib/textui/log_test.go +++ b/lib/textui/log_test.go @@ -16,7 +16,7 @@ import ( ) func logLineRegexp(inner string) string { - return `[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{4} ` + inner + ` \(from lib/textui/log_test\.go:[0-9]+\)\n` + return `[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{4} ` + inner + ` \(from lib/textui/log_test\.go:[0-9]+\)\n` } func TestLogFormat(t *testing.T) { |