update crap logging
This commit is contained in:
		| @@ -3,6 +3,7 @@ package log | ||||
|  | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| @@ -46,7 +47,8 @@ type FormatFunc func(Record) string | ||||
|  | ||||
| // TextFormat returns text format | ||||
| func TextFormat(r Record) string { | ||||
| 	return r.Message.(string) | ||||
| 	t := r.Timestamp.Format("2006-01-02 15:04:05") | ||||
| 	return fmt.Sprintf("%s %v", t, r.Message) | ||||
| } | ||||
|  | ||||
| // JSONFormat is a json Format func | ||||
|   | ||||
| @@ -3,7 +3,6 @@ package service | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/micro/go-micro/client" | ||||
| @@ -34,7 +33,7 @@ func (d *debugClient) Log(since time.Time, count int, stream bool) (log.Stream, | ||||
| 	// get the log stream | ||||
| 	serverStream, err := d.Client.Log(context.Background(), req) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed getting log stream: %s", err) | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	lg := &logStream{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user