Improve logging, hook up ion with zap logger

This commit is contained in:
David Zhao
2021-06-09 12:31:29 -07:00
parent 321ebab99b
commit abedc05ce5
9 changed files with 59 additions and 60 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ var ServiceSet = wire.NewSet(
)
func handleError(w http.ResponseWriter, status int, msg string) {
l := logger.Desugar().WithOptions(zap.AddCallerSkip(1))
l := logger.GetLogger().WithOptions(zap.AddCallerSkip(1))
l.Debug("error handling request", zap.String("error", msg), zap.Int("status", status))
w.WriteHeader(status)
_, _ = w.Write([]byte(msg))