diff --git a/internal/client/captcha/captcha.go b/internal/client/captcha/captcha.go index 07b8a04..84a2875 100644 --- a/internal/client/captcha/captcha.go +++ b/internal/client/captcha/captcha.go @@ -27,14 +27,10 @@ import ( // Log is the package-level logger. Defaults to no-op; main wires it via // SetLogger so captcha output respects the global -debug flag and levels. -// -// Deprecated: pass a logx.Logger to Solve directly. SetLogger remains for -// callers that cannot be updated (e.g. auto_solver.go uses captcha.Log directly). +// Solve also accepts an explicit logger parameter for callers that want DI. var Log logx.Logger = logx.Nop() // SetLogger installs a logger for this package. Safe to call once at startup. -// -// Deprecated: prefer passing a logx.Logger to Solve. func SetLogger(l logx.Logger) { Log = logx.OrNop(l) } const ( @@ -158,10 +154,7 @@ func Solve( return "", solveErr } - backoffSteps := attempt - if backoffSteps > 10 { - backoffSteps = 10 - } + backoffSteps := min(attempt, 10) timer := time.NewTimer(time.Duration(backoffSteps) * 500 * time.Millisecond) select { case <-ctx.Done(): diff --git a/internal/client/captcha/manual/manual.go b/internal/client/captcha/manual/manual.go index 84fb62a..7ba07a1 100644 --- a/internal/client/captcha/manual/manual.go +++ b/internal/client/captcha/manual/manual.go @@ -35,14 +35,9 @@ var Debug bool // Log is the package-level logger; defaults to no-op. main wires it via // SetLogger so manual-captcha output respects -debug and levels. -// -// Deprecated: future refactoring should inject the logger via a Solver struct. -// SetLogger remains for backward compatibility. var Log logx.Logger = logx.Nop() // SetLogger installs a logger for this package. -// -// Deprecated: prefer a Solver struct with an explicit Logger field. func SetLogger(l logx.Logger) { Log = logx.OrNop(l) } const captchaListenPort = "8765" diff --git a/internal/client/dnsdial/doh.go b/internal/client/dnsdial/doh.go index 90149f8..dbc6db1 100644 --- a/internal/client/dnsdial/doh.go +++ b/internal/client/dnsdial/doh.go @@ -27,15 +27,9 @@ import ( // Log is the package-level logger. Defaults to no-op; main wires it via // SetLogger so DNS-mode output respects the global -debug flag and levels. -// -// Deprecated: dnsdial is a procedural package with global state; a future -// refactor should thread a logger through AppDialer/InstallGlobalResolver. -// SetLogger remains for backward compatibility. var Log logx.Logger = logx.Nop() // SetLogger installs a logger for this package. -// -// Deprecated: prefer threading a logx.Logger through AppDialer. func SetLogger(l logx.Logger) { Log = logx.OrNop(l) } const (