diff --git a/gitCheckout.go b/gitCheckout.go index 135dfaf..727cf8c 100644 --- a/gitCheckout.go +++ b/gitCheckout.go @@ -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 } diff --git a/goSrcScan.go b/goSrcScan.go index 325aae2..a934b15 100644 --- a/goSrcScan.go +++ b/goSrcScan.go @@ -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 diff --git a/log.go b/log.go index e8663b1..012aca9 100644 --- a/log.go +++ b/log.go @@ -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") }