update crap logging
This commit is contained in:
parent
95ae2688a2
commit
ae12fd1021
@ -3,6 +3,7 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,7 +47,8 @@ type FormatFunc func(Record) string
|
|||||||
|
|
||||||
// TextFormat returns text format
|
// TextFormat returns text format
|
||||||
func TextFormat(r Record) string {
|
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
|
// JSONFormat is a json Format func
|
||||||
|
@ -3,7 +3,6 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/client"
|
"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
|
// get the log stream
|
||||||
serverStream, err := d.Client.Log(context.Background(), req)
|
serverStream, err := d.Client.Log(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed getting log stream: %s", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
lg := &logStream{
|
lg := &logStream{
|
||||||
|
Loading…
Reference in New Issue
Block a user