From befca816d542bee8ad7d819fec847e2379dffe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Sima=CC=83o?= Date: Mon, 29 Nov 2021 10:44:03 -0300 Subject: [PATCH] add printf to log --- types/lib.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/lib.go b/types/lib.go index c6765ca..6262908 100644 --- a/types/lib.go +++ b/types/lib.go @@ -228,6 +228,11 @@ func (l *Log) AddHistory(s string) { } } +func (l *Log) Printf(s string, i ...interface{}) { + l.AddHistory(fmt.Sprintf(s, i...)) + s = fmt.Sprintf("* %s: %s", time.Now().Format("02/01/06 - 15:04:05"), s) +} + type LogQuery struct { From time.Time `json:"from"` Until time.Time `json:"until"`