1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00
go-micro/debug/log/memory/stream.go

25 lines
312 B
Go
Raw Normal View History

2019-12-17 20:16:45 +02:00
package memory
import (
2024-06-04 22:40:43 +02:00
"go-micro.dev/v5/debug/log"
2019-12-17 20:16:45 +02:00
)
2019-12-17 18:56:55 +02:00
type logStream struct {
2019-12-17 20:16:45 +02:00
stream <-chan log.Record
2019-12-17 18:56:55 +02:00
stop chan bool
}
2019-12-17 20:16:45 +02:00
func (l *logStream) Chan() <-chan log.Record {
2019-12-17 18:56:55 +02:00
return l.stream
}
func (l *logStream) Stop() error {
select {
case <-l.stop:
return nil
default:
close(l.stop)
}
return nil
}