Newer
Older
// Key to use when setting the request ID.
type ctxKeyLogger int
// RequestIDKey is the key that holds the unique request ID in a request context.
const LoggerKey ctxKeyLogger = 76
func Logger(next codec.Handler) codec.Handler {
fn := func(w codec.ResponseWriter, r *codec.Request) {
Str("params", string(r.Msg().Params))
next.ServeRPC(w, r.WithContext(context.WithValue(r.Context(), LoggerKey, l)))