This PR refines the next-generation proxy internals and workspace
documentation:
- Reworks internal/logger to expose clearer slog-style APIs:
- Replaces Vf/Df/Wf/Ef with Info/Debug/Warn/Error.
- Adds structured key/value log arguments.
- Adds version to every log record.
- Uses standard slog level labels (DEBUG, INFO, WARN, ERROR).
- Keeps compatibility for existing printf-style messages.
- Renames proxy configuration abstractions:
- Environment → ProxyEnvironment.
- NewEnvironment → NewProxyEnvironment.
- Regenerates/renames the counterfeiter fake to FakeProxyEnvironment.
- Updates all proxy bootstrap, load balancer, protocol, signal, debug,
and utility call sites for the new logger and
environment APIs.
- Consolidates proxy codebase navigation:
- Deletes docs/proxy/proxy-files.md.
- Moves the useful file/module map details into
.openclaw/memory/srs-codebase-map.md.
- Replaces agent instruction symlinks with explicit workspace
instruction files for Claude, Codex, and Kiro.
- Updates OpenClaw tool notes with Codex commit-prefix guidance.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
394 B
Go
22 lines
394 B
Go
// Copyright (c) 2026 Winlin
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
package debug
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"srsx/internal/env"
|
|
"srsx/internal/logger"
|
|
)
|
|
|
|
func HandleGoPprof(ctx context.Context, environment env.ProxyEnvironment) {
|
|
if addr := environment.GoPprof(); addr != "" {
|
|
go func() {
|
|
logger.Debug(ctx, "Start Go pprof at %v", addr)
|
|
http.ListenAndServe(addr, nil)
|
|
}()
|
|
}
|
|
}
|