probeHTTP emits a [PROBE/http] log tagged with the connID pulled from the parser context and a phase name. Cheap to call when the probe is off (single atomic load + early return).
(ctx context.Context, logger *zap.Logger, phase string, fields ...zap.Field)
| 43 | // the parser context and a phase name. Cheap to call when the probe is |
| 44 | // off (single atomic load + early return). |
| 45 | func probeHTTP(ctx context.Context, logger *zap.Logger, phase string, fields ...zap.Field) { |
| 46 | if !probeHTTPOn() { |
| 47 | return |
| 48 | } |
| 49 | connID, _ := ctx.Value(models.ClientConnectionIDKey).(string) |
| 50 | base := []zap.Field{ |
| 51 | zap.String("probe", "http"), |
| 52 | zap.String("phase", phase), |
| 53 | zap.String("connID", connID), |
| 54 | zap.Int64("ts_ns", time.Now().UnixNano()), |
| 55 | } |
| 56 | logger.Info("[PROBE/http]", append(base, fields...)...) |
| 57 | } |
| 58 | |
| 59 | // encodeHTTP records outgoing HTTP traffic. The read/forward/chunked-handling |
| 60 | // logic is identical to the original synchronous implementation. The only |
no test coverage detected