transform log in writer

nats
Paulo Simão 2021-10-14 06:56:11 -03:00
parent 9602c569ec
commit 84ddbfbe69
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package types
import (
"encoding/json"
"fmt"
"os"
"strconv"
"time"
)
@ -213,6 +214,7 @@ type Log struct {
}
func (l *Log) Write(p []byte) (n int, err error) {
os.Stdout.Write([]byte(fmt.Sprintf("- %s\n", string(p))))
l.AddHistory(string(p))
return len(p), nil
}