refactor(logx): заменить Deps{Debug,Debugf} на интерфейс logx.Logger

Добавляет internal/logx с Debugf/Infof/Warnf/Errorf + DebugEnabled().
Протягивает logx.Logger через bondclient, bondserver, proxy/udp, proxy/vless,
vkauth. Убирает глобалы isDebug/debugf из обоих бинарей. Переносит
globalBondRegistry из package init в main (инициализация после
config.ParseServer), закрывая давний footgun "Debug=false на init".
This commit is contained in:
samosvalishe committed 2026-05-19 17:54:19 +03:00
1 parent acbd90f52e
commit 7fd2d9594d
10 files changed
+157 -111

No files matched your search

+2 -2
View File
@@ -56,7 +56,7 @@ func (f *fakeStream) writtenFrames(t *testing.T) []bond.Frame {
func newTestConn(t *testing.T) *serverConn {
t.Helper()
deps := &Deps{Debug: false, Debugf: func(string, ...any) {}}
deps := &Deps{}
ctx, cancel := context.WithCancel(t.Context())
t.Cleanup(cancel)
return &serverConn{
@@ -248,7 +248,7 @@ func TestWriteToNextLaneAllFail(t *testing.T) {
// TestRegistryGetDedup ensures concurrent get() calls for the same ConnID
// share one serverConn, and that completion removes it from the registry.
func TestRegistryGetDedup(t *testing.T) {
r := NewRegistry(Deps{Debugf: func(string, ...any) {}})
r := NewRegistry(Deps{})
ctx := t.Context()
c1 := r.get(ctx, 7, "127.0.0.1:1")