fix the dumb names

This commit is contained in:
Jeff Carr 2025-01-08 03:12:53 -06:00
parent 26cf5055a2
commit 8aff3f13b2
3 changed files with 21 additions and 21 deletions

View File

@ -14,12 +14,12 @@ func (f *Forge) GitPull() bool {
var localonly int
var badmap int
log.Log(FORGEPBWARN, "running git pull everywhere")
log.Log(WARN, "running git pull everywhere")
var failed int = 0
for all.Scan() {
repo := all.Next()
if out, err := repo.GitPull(); err == nil {
log.Log(FORGEPBWARN, "Ran git pull ok", repo.GetGoPath(), out)
log.Log(WARN, "Ran git pull ok", repo.GetGoPath(), out)
} else {
failed += 1
// repo.DumpTags()
@ -28,20 +28,20 @@ func (f *Forge) GitPull() bool {
continue
}
badmap += 1
log.Log(FORGEPBWARN, "bad unknown git error", repo.GetGoPath(), out, err)
log.Log(WARN, "bad unknown git error", repo.GetGoPath(), out, err)
}
}
log.Log(FORGEPBWARN, "Ran git pull in all repos. failure count =", failed)
log.Log(FORGEPBWARN, "Ran git pull in all repos. bad errors =", badmap)
log.Log(WARN, "Ran git pull in all repos. failure count =", failed)
log.Log(WARN, "Ran git pull in all repos. bad errors =", badmap)
if localonly != 0 {
log.Log(FORGEPBWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
log.Log(WARN, "Ran git pull in all repos. ignored local only branches =", localonly)
}
*/
return true
}
func (f *Forge) CheckoutDevel() bool {
log.Log(FORGEPBWARN, "running git checkout devel everwhere")
log.Log(WARN, "running git checkout devel everwhere")
var failed int = 0
var count int = 0
all := f.Repos.SortByFullPath()
@ -58,7 +58,7 @@ func (f *Forge) CheckoutDevel() bool {
}
}
}
log.Log(FORGEPBWARN, "Ran git checkout in", count, "repos. failure count =", failed)
log.Log(WARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
@ -115,7 +115,7 @@ func (f *Forge) makeBranch(repo *gitpb.Repo, bname string) error {
}
func (f *Forge) CheckoutMaster() bool {
log.Log(FORGEPBWARN, "running git checkout master everwhere")
log.Log(WARN, "running git checkout master everwhere")
var failed int = 0
var count int = 0
all := f.Repos.SortByFullPath()
@ -128,12 +128,12 @@ func (f *Forge) CheckoutMaster() bool {
failed += 1
}
}
log.Log(FORGEPBWARN, "Ran git checkout in", count, "repos. failure count =", failed)
log.Log(WARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
func (f *Forge) CheckoutUser() bool {
log.Log(FORGEPBWARN, "running git checkout user everwhere")
log.Log(WARN, "running git checkout user everwhere")
var failed int = 0
var count int = 0
all := f.Repos.SortByFullPath()
@ -150,12 +150,12 @@ func (f *Forge) CheckoutUser() bool {
failed += 1
}
}
log.Log(FORGEPBWARN, "Ran git checkout in", count, "repos. failure count =", failed)
log.Log(WARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
func (f *Forge) CheckoutUserForce() bool {
log.Log(FORGEPBWARN, "running git checkout user everwhere")
log.Log(WARN, "running git checkout user everwhere")
var failed int = 0
var count int = 0
all := f.Repos.SortByFullPath()
@ -168,6 +168,6 @@ func (f *Forge) CheckoutUserForce() bool {
failed += 1
}
}
log.Log(FORGEPBWARN, "Ran git checkout in", count, "repos. failure count =", failed)
log.Log(WARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}

View File

@ -30,7 +30,7 @@ func (f *Forge) ScanGoSrc() (bool, error) {
}
gopaths = append(gopaths, gopath)
} else {
log.Log(FORGEPBWARN, "ScanGoSrc() bad:", dir)
log.Log(WARN, "ScanGoSrc() bad:", dir)
return false, errors.New("forgepb.ScanGoSrc() bad dir: " + dir)
}
}
@ -106,7 +106,7 @@ func gitDirectoriesOld(srcDir string) ([]string, error) {
var all []string
err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
log.Log(FORGEPBWARN, "Error accessing path:", path, err)
log.Log(WARN, "Error accessing path:", path, err)
return nil
}
@ -119,7 +119,7 @@ func gitDirectoriesOld(srcDir string) ([]string, error) {
})
if err != nil {
log.Log(FORGEPBWARN, "Error walking the path:", srcDir, err)
log.Log(WARN, "Error walking the path:", srcDir, err)
}
return all, err

8
log.go
View File

@ -4,13 +4,13 @@ import (
"go.wit.com/log"
)
var FORGEPB *log.LogFlag
var FORGEPBWARN *log.LogFlag
var INFO *log.LogFlag
var WARN *log.LogFlag
func init() {
full := "go.wit.com/lib/protobuf/forgepb"
short := "forgepb"
FORGEPB = log.NewFlag("FORGEPB", false, full, short, "general forgepb things")
FORGEPBWARN = log.NewFlag("FORGEPBWARN", true, full, short, "forgepb warnings")
INFO = log.NewFlag("INFO", false, full, short, "general forgepb things")
WARN = log.NewFlag("WARN", true, full, short, "forgepb warnings")
}