transform log in writer

This commit is contained in:
Paulo Simão 2021-10-14 06:24:39 -03:00
parent a6a48c459b
commit 9602c569ec

View File

@ -212,6 +212,11 @@ type Log struct {
History string `json:"history,omitempty"`
}
func (l *Log) Write(p []byte) (n int, err error) {
l.AddHistory(string(p))
return len(p), nil
}
func (l *Log) AddHistory(s string) {
s = fmt.Sprintf("* %s: %s", time.Now().Format("02/01/06 - 15:04:05"), s)
if l.History == "" {