2019-12-17 18:16:45 +00:00
|
|
|
package memory
|
|
|
|
|
|
|
|
import (
|
2020-08-19 17:47:17 +03:00
|
|
|
"github.com/unistack-org/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
|
|
|
|
}
|