mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Embed logger into debug.Handler
This commit is contained in:
parent
ee9776e7b2
commit
9e177be560
@ -5,6 +5,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/micro/go-micro/debug/log"
|
||||||
|
|
||||||
proto "github.com/micro/go-micro/debug/proto"
|
proto "github.com/micro/go-micro/debug/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,6 +17,7 @@ var (
|
|||||||
|
|
||||||
type Debug struct {
|
type Debug struct {
|
||||||
started int64
|
started int64
|
||||||
|
log.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func newDebug() *Debug {
|
func newDebug() *Debug {
|
||||||
|
@ -40,7 +40,12 @@ func (l *defaultLogger) Write(v ...interface{}) {
|
|||||||
|
|
||||||
// Read reads logs from the logger
|
// Read reads logs from the logger
|
||||||
func (l *defaultLogger) Read(n int) []interface{} {
|
func (l *defaultLogger) Read(n int) []interface{} {
|
||||||
return l.Get(n)
|
entries := l.Get(n)
|
||||||
|
vals := make([]interface{}, 0, len(entries))
|
||||||
|
for _, val := range entries {
|
||||||
|
vals = append(vals, val)
|
||||||
|
}
|
||||||
|
return vals
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *defaultLogger) log(entry string) {
|
func (l *defaultLogger) log(entry string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user