mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
26 lines
339 B
Go
26 lines
339 B
Go
package service
|
|
|
|
import (
|
|
"github.com/micro/go-micro/debug/log"
|
|
)
|
|
|
|
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
|
|
}
|