2019-12-17 21:16:45 +03:00
|
|
|
package memory
|
|
|
|
|
|
|
|
import (
|
2020-08-19 17:47:17 +03:00
|
|
|
"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
|
|
|
|
}
|