micro/debug/log/memory/stream.go

25 lines
329 B
Go
Raw Normal View History

2019-12-17 21:16:45 +03:00
package memory
import (
"github.com/unistack-org/micro/v3/debug/log"
2019-12-17 21:16:45 +03:00
)
2019-12-17 19:56:55 +03:00
type logStream struct {
2019-12-17 21:16:45 +03:00
stream <-chan log.Record
2019-12-17 19:56:55 +03:00
stop chan bool
}
2019-12-17 21:16:45 +03:00
func (l *logStream) Chan() <-chan log.Record {
2019-12-17 19:56:55 +03:00
return l.stream
}
func (l *logStream) Stop() error {
select {
case <-l.stop:
return nil
default:
close(l.stop)
}
return nil
}