Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2553)

Unified Diff: go/src/infra/monitoring/dispatcher/dispatcher.go

Issue 1149313002: go: Replace Logrus with go-logging. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: typo Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/monitoring/client/client.go ('k') | go/src/infra/monitoring/messages/alerts.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/monitoring/dispatcher/dispatcher.go
diff --git a/go/src/infra/monitoring/dispatcher/dispatcher.go b/go/src/infra/monitoring/dispatcher/dispatcher.go
index 9d642bde81189de1d3d3997b3794cd035139446f..9ae04e1dc5e8839a63c8d077cbfe3451b2b6230b 100644
--- a/go/src/infra/monitoring/dispatcher/dispatcher.go
+++ b/go/src/infra/monitoring/dispatcher/dispatcher.go
@@ -20,7 +20,7 @@ import (
"strings"
"time"
- "github.com/Sirupsen/logrus"
+ "infra/libs/logging"
"infra/monitoring/analyzer"
"infra/monitoring/messages"
@@ -37,7 +37,7 @@ var (
builderOnly = flag.String("builder", "", "Only check this builder")
buildOnly = flag.Int64("build", 0, "Only check this build")
- log = logrus.New()
+ log = logging.DefaultLogger
// gk is the gatekeeper config.
gk = &struct {
@@ -94,19 +94,22 @@ func main() {
err := readJSONFile(*gatekeeperJSON, &gk)
if err != nil {
- log.Fatalf("Error reading gatekeeper json: %v", err)
+ log.Errorf("Error reading gatekeeper json: %v", err)
+ os.Exit(1)
}
err = readJSONFile(*gatekeeperTreesJSON, &gkt)
if err != nil {
- log.Fatalf("Error reading gatekeeper json: %v", err)
+ log.Errorf("Error reading gatekeeper json: %v", err)
+ os.Exit(1)
}
a := analyzer.New(nil, 2, 5)
for masterURL, masterCfgs := range gk.Masters {
if len(masterCfgs) != 1 {
- log.Fatalf("Multiple configs for master: %s", masterURL)
+ log.Errorf("Multiple configs for master: %s", masterURL)
+ os.Exit(1)
}
masterName := masterFromURL(masterURL)
a.MasterCfgs[masterName] = masterCfgs[0]
@@ -123,7 +126,8 @@ func main() {
masterNames = append(masterNames, masterFromURL(url))
}
} else {
- log.Fatalf("Unrecoginzed tree: %s", *treeOnly)
+ log.Errorf("Unrecoginzed tree: %s", *treeOnly)
+ os.Exit(1)
}
}
« no previous file with comments | « go/src/infra/monitoring/client/client.go ('k') | go/src/infra/monitoring/messages/alerts.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698