refactor(client): убрать deprecated-теги с package-level логгеров

cmd/client — однопроцессный CLI; package-level Log+SetLogger остаётся
каноническим API. captcha.Solve по-прежнему принимает явный логгер для DI.
Также осовременен backoffSteps через min().
This commit is contained in:
samosvalishe committed 2026-05-21 01:20:54 +03:00
1 parent 5735b4a297
commit 6b8b82f530
3 files changed
+2 -20

No files matched your search

+2 -9
View File
@@ -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():