Move logger
This commit is contained in:
24
debug/log/memory/stream.go
Normal file
24
debug/log/memory/stream.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package memory
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/debug/log"
|
||||
)
|
||||
|
||||
type logStream struct {
|
||||
stream <-chan log.Record
|
||||
stop chan bool
|
||||
}
|
||||
|
||||
func (l *logStream) Chan() <-chan log.Record {
|
||||
return l.stream
|
||||
}
|
||||
|
||||
func (l *logStream) Stop() error {
|
||||
select {
|
||||
case <-l.stop:
|
||||
return nil
|
||||
default:
|
||||
close(l.stop)
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user