mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
misc: each module now has its own tagged logging
This commit is contained in:
parent
9003be56ca
commit
9cd4e380fb
47 changed files with 343 additions and 349 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/bettercap/bettercap/core"
|
||||
"github.com/bettercap/bettercap/log"
|
||||
"github.com/bettercap/bettercap/session"
|
||||
|
||||
"github.com/google/go-github/github"
|
||||
|
@ -82,17 +81,17 @@ func (u *UpdateModule) Start() error {
|
|||
return u.SetRunning(true, func() {
|
||||
defer u.SetRunning(false, nil)
|
||||
|
||||
log.Info("checking latest stable release ...")
|
||||
u.Info("checking latest stable release ...")
|
||||
|
||||
if releases, _, err := u.client.Repositories.ListReleases(context.Background(), "bettercap", "bettercap", nil); err == nil {
|
||||
latest := releases[0]
|
||||
if u.versionToNum(core.Version) < u.versionToNum(*latest.TagName) {
|
||||
u.Session.Events.Add("update.available", latest)
|
||||
} else {
|
||||
log.Info("you are running %s which is the latest stable version.", tui.Bold(core.Version))
|
||||
u.Info("you are running %s which is the latest stable version.", tui.Bold(core.Version))
|
||||
}
|
||||
} else {
|
||||
log.Error("error while fetching latest release info from GitHub: %s", err)
|
||||
u.Error("error while fetching latest release info from GitHub: %s", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue