mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
remove use of glog
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
log "github.com/golang/glog"
|
||||
"log"
|
||||
|
||||
"github.com/micro/go-micro/cmd"
|
||||
"github.com/micro/go-micro/examples/server/subscriber"
|
||||
"github.com/micro/go-micro/server"
|
||||
@ -13,16 +14,16 @@ import (
|
||||
type Example struct{}
|
||||
|
||||
func (e *Example) Call(ctx context.Context, req *example.Request, rsp *example.Response) error {
|
||||
log.Info("Received Example.Call request")
|
||||
log.Print("Received Example.Call request")
|
||||
rsp.Msg = server.DefaultOptions().Id + ": Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *Example) Stream(ctx context.Context, req *example.StreamingRequest, stream example.Example_StreamStream) error {
|
||||
log.Infof("Received Example.Stream request with count: %d", req.Count)
|
||||
log.Printf("Received Example.Stream request with count: %d", req.Count)
|
||||
|
||||
for i := 0; i < int(req.Count); i++ {
|
||||
log.Infof("Responding: %d", i)
|
||||
log.Printf("Responding: %d", i)
|
||||
if err := stream.Send(&example.StreamingResponse{
|
||||
Count: int64(i),
|
||||
}); err != nil {
|
||||
@ -39,7 +40,7 @@ func (e *Example) PingPong(ctx context.Context, stream example.Example_PingPongS
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("Got ping %v", req.Stroke)
|
||||
log.Printf("Got ping %v", req.Stroke)
|
||||
if err := stream.Send(&example.Pong{Stroke: req.Stroke}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user