diff --git a/internal/runner.go b/internal/runner.go index 682e5e4..31261f7 100644 --- a/internal/runner.go +++ b/internal/runner.go @@ -340,14 +340,14 @@ func (r *Runner) PrintStat(pool *pool.BrutePool) { if r.Color { logs.Log.Important(pool.Statistor.ColorString()) if pool.Statistor.Error == "" { - pool.Statistor.PrintColorCount() - pool.Statistor.PrintColorSource() + logs.Log.Log(pkg.LogVerbose, pool.Statistor.ColorCountString()) + logs.Log.Log(pkg.LogVerbose, pool.Statistor.ColorSourceString()) } } else { logs.Log.Important(pool.Statistor.String()) if pool.Statistor.Error == "" { - pool.Statistor.PrintCount() - pool.Statistor.PrintSource() + logs.Log.Log(pkg.LogVerbose, pool.Statistor.CountString()) + logs.Log.Log(pkg.LogVerbose, pool.Statistor.SourceString()) } } diff --git a/pkg/statistor.go b/pkg/statistor.go index 7f01569..a57aac4 100644 --- a/pkg/statistor.go +++ b/pkg/statistor.go @@ -111,9 +111,9 @@ func (stat *Statistor) String() string { return s.String() } -func (stat *Statistor) PrintCount() { +func (stat *Statistor) CountString() string { if len(stat.Counts) == 0 { - return + return "" } var s strings.Builder s.WriteString("[stat] ") @@ -124,12 +124,12 @@ func (stat *Statistor) PrintCount() { } s.WriteString(fmt.Sprintf(" %d: %d,", k, v)) } - logs.Log.Important(s.String()) + return s.String() } -func (stat *Statistor) PrintSource() { +func (stat *Statistor) SourceString() string { if len(stat.Sources) == 0 { - return + return "" } var s strings.Builder s.WriteString("[stat] ") @@ -137,12 +137,12 @@ func (stat *Statistor) PrintSource() { for k, v := range stat.Sources { s.WriteString(fmt.Sprintf(" %s: %d,", k.Name(), v)) } - logs.Log.Important(s.String()) + return s.String() } -func (stat *Statistor) PrintColorCount() { +func (stat *Statistor) ColorCountString() string { if len(stat.Counts) == 0 { - return + return "" } var s strings.Builder s.WriteString(fmt.Sprintf("[stat] %s ", stat.BaseUrl)) @@ -152,19 +152,19 @@ func (stat *Statistor) PrintColorCount() { } s.WriteString(fmt.Sprintf(" %s: %s,", logs.Cyan(strconv.Itoa(k)), logs.YellowBold(strconv.Itoa(v)))) } - logs.Log.Important(s.String()) + return s.String() } -func (stat *Statistor) PrintColorSource() { +func (stat *Statistor) ColorSourceString() string { if len(stat.Sources) == 0 { - return + return "" } var s strings.Builder s.WriteString(fmt.Sprintf("[stat] %s ", stat.BaseUrl)) for k, v := range stat.Sources { s.WriteString(fmt.Sprintf(" %s: %s,", logs.Cyan(k.Name()), logs.YellowBold(strconv.Itoa(v)))) } - logs.Log.Important(s.String()) + return s.String() } func (stat *Statistor) Json() string {