add printf to log

master
Paulo Simão 2021-11-29 10:44:03 -03:00
parent bca0854a85
commit befca816d5
1 changed files with 5 additions and 0 deletions

View File

@ -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 { type LogQuery struct {
From time.Time `json:"from"` From time.Time `json:"from"`
Until time.Time `json:"until"` Until time.Time `json:"until"`