From d3ccb39592f8ffe40b000e7c830f87d3778badd7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 9 Oct 2016 11:44:34 +0200 Subject: log: prepend time to cached entries --- log/log.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/log/log.go b/log/log.go index 752b72bd6..cf1bad78a 100644 --- a/log/log.go +++ b/log/log.go @@ -14,6 +14,7 @@ import ( "fmt" golog "log" "sync" + "time" ) var ( @@ -72,7 +73,7 @@ func Logf(v int, msg string, args ...interface{}) { if cacheMem < 0 { panic("log cache size underflow") } - cacheEntries[cachePos] = fmt.Sprintf(msg, args...) + cacheEntries[cachePos] = fmt.Sprintf(time.Now().Format("2006/01/02 15:04:05 ")+msg, args...) cacheMem += len(cacheEntries[cachePos]) cachePos++ if cachePos == len(cacheEntries) { -- cgit mrf-deployment