wspr: Use the global logger in the vlog package for logging.
This simplifies the code but doesn't change behavior. I'm also
going to get rid of the code that attaches a logger to the runtime
which nobody is using effectively now.
Change-Id: Iff4c377b573ceeeec8f35056a9b55b5c12812ff8
diff --git a/services/wsprd/app/app.go b/services/wsprd/app/app.go
index 1bb959f..c3d1a93 100644
--- a/services/wsprd/app/app.go
+++ b/services/wsprd/app/app.go
@@ -254,11 +254,6 @@
}
}
-// GetLogger returns a Veyron logger to use.
-func (c *Controller) GetLogger() vlog.Logger {
- return veyron2.GetLogger(c.ctx)
-}
-
// RT returns the runtime of the app.
func (c *Controller) Context() *context.T {
return c.ctx
@@ -274,7 +269,7 @@
// Cleanup cleans up any outstanding rpcs.
func (c *Controller) Cleanup() {
- c.GetLogger().VI(0).Info("Cleaning up controller")
+ vlog.VI(0).Info("Cleaning up controller")
c.Lock()
defer c.Unlock()
@@ -412,7 +407,7 @@
request.stream.end()
return
}
- c.GetLogger().Errorf("close called on non-existent call: %v", id)
+ vlog.Errorf("close called on non-existent call: %v", id)
}
func (c *Controller) maybeCreateServer(serverId uint32) (*server.Server, error) {
@@ -449,7 +444,7 @@
w.Error(verror2.Convert(verror2.Internal, nil, err))
}
- c.GetLogger().VI(2).Infof("serving under name: %q", serveRequest.Name)
+ vlog.VI(2).Infof("serving under name: %q", serveRequest.Name)
if err := server.Serve(serveRequest.Name); err != nil {
w.Error(verror2.Convert(verror2.Internal, nil, err))
@@ -481,7 +476,7 @@
server := c.flowMap[id]
c.Unlock()
if server == nil {
- c.GetLogger().Errorf("unexpected result from JavaScript. No channel "+
+ vlog.Errorf("unexpected result from JavaScript. No channel "+
"for MessageId: %d exists. Ignoring the results.", id)
//Ignore unknown responses that don't belong to any channel
return
@@ -496,7 +491,7 @@
server := c.flowMap[id]
c.Unlock()
if server == nil {
- c.GetLogger().Errorf("unexpected result from JavaScript. No channel "+
+ vlog.Errorf("unexpected result from JavaScript. No channel "+
"for MessageId: %d exists. Ignoring the results.", id)
//Ignore unknown responses that don't belong to any channel
return
@@ -584,7 +579,7 @@
server := c.flowMap[id]
c.Unlock()
if server == nil {
- c.GetLogger().Errorf("unexpected result from JavaScript. No channel "+
+ vlog.Errorf("unexpected result from JavaScript. No channel "+
"for MessageId: %d exists. Ignoring the results.", id)
//Ignore unknown responses that don't belong to any channel
return
@@ -598,7 +593,7 @@
if err := lib.VomDecode(data, &msg); err != nil {
return nil, err
}
- c.GetLogger().VI(2).Infof("VeyronRPC: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
+ vlog.VI(2).Infof("VeyronRPC: %s.%s(..., streaming=%v)", msg.Name, msg.Method, msg.IsStreaming)
return &msg, nil
}
@@ -620,7 +615,7 @@
return
}
- c.GetLogger().VI(2).Infof("requesting Signature for %q", request.Name)
+ vlog.VI(2).Infof("requesting Signature for %q", request.Name)
sig, err := c.getSignature(ctx, request.Name)
if err != nil {
w.Error(err)