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

Side by Side Diff: go/src/infra/monitoring/client/client.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package client 5 package client
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "fmt" 9 "fmt"
10 "io/ioutil" 10 "io/ioutil"
11 "net/http" 11 "net/http"
12 "net/url" 12 "net/url"
13 "strings" 13 "strings"
14 "sync/atomic" 14 "sync/atomic"
15 15
16 » "github.com/Sirupsen/logrus" 16 » "infra/libs/logging"
17 17
18 "infra/monitoring/messages" 18 "infra/monitoring/messages"
19 ) 19 )
20 20
21 var ( 21 var (
22 » log = logrus.New() 22 » log = logging.DefaultLogger
23 ) 23 )
24 24
25 // MasterURL returns the builder URL for the given master. 25 // MasterURL returns the builder URL for the given master.
26 func MasterURL(master string) string { 26 func MasterURL(master string) string {
27 return fmt.Sprintf("https://build.chromium.org/p/%s", master) 27 return fmt.Sprintf("https://build.chromium.org/p/%s", master)
28 } 28 }
29 29
30 // BuilderURL returns the builder URL for the given master and builder. 30 // BuilderURL returns the builder URL for the given master and builder.
31 func BuilderURL(master, builder string) string { 31 func BuilderURL(master, builder string) string {
32 return fmt.Sprintf("https://build.chromium.org/p/%s/builders/%s", master , oldEscape(builder)) 32 return fmt.Sprintf("https://build.chromium.org/p/%s/builders/%s", master , oldEscape(builder))
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 log.Infof("Fetched(%d) text: %s", resp.StatusCode, url) 270 log.Infof("Fetched(%d) text: %s", resp.StatusCode, url)
271 return length, err 271 return length, err
272 }) 272 })
273 return ret, status, nil 273 return ret, status, nil
274 } 274 }
275 275
276 func (c *client) DumpStats() { 276 func (c *client) DumpStats() {
277 log.Infof("%d reqs total, %d errors, %d current", c.totalReqs, c.totalEr rs, c.currReqs) 277 log.Infof("%d reqs total, %d errors, %d current", c.totalReqs, c.totalEr rs, c.currReqs)
278 log.Infof("%d bytes read", c.totalBytes) 278 log.Infof("%d bytes read", c.totalBytes)
279 } 279 }
OLDNEW
« no previous file with comments | « go/src/infra/monitoring/analyzer/analyzer.go ('k') | go/src/infra/monitoring/dispatcher/dispatcher.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698