1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/debug/service/stream.go

26 lines
342 B
Go
Raw Normal View History

2019-12-17 18:56:55 +02:00
package service
import (
"github.com/micro/go-micro/v2/debug/log"
2019-12-17 18:56:55 +02:00
)
type logStream struct {
stream chan log.Record
stop chan bool
}
func (l *logStream) Chan() <-chan log.Record {
return l.stream
}
func (l *logStream) Stop() error {
select {
case <-l.stop:
return nil
default:
close(l.stream)
close(l.stop)
}
return nil
}