2019-12-17 18:16:45 +00:00
|
|
|
package memory
|
|
|
|
|
|
|
|
import (
|
2020-07-27 13:22:00 +01:00
|
|
|
"github.com/micro/go-micro/v3/debug/log"
|
2019-12-17 18:16:45 +00:00
|
|
|
)
|
2019-12-17 16:56:55 +00:00
|
|
|
|
|
|
|
type logStream struct {
|
2019-12-17 18:16:45 +00:00
|
|
|
stream <-chan log.Record
|
2019-12-17 16:56:55 +00:00
|
|
|
stop chan bool
|
|
|
|
}
|
|
|
|
|
2019-12-17 18:16:45 +00:00
|
|
|
func (l *logStream) Chan() <-chan log.Record {
|
2019-12-17 16:56:55 +00:00
|
|
|
return l.stream
|
|
|
|
}
|
|
|
|
|
|
|
|
func (l *logStream) Stop() error {
|
|
|
|
select {
|
|
|
|
case <-l.stop:
|
|
|
|
return nil
|
|
|
|
default:
|
|
|
|
close(l.stop)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|