Cleanup logging

This commit is contained in:
Alexander Klizhentas
2014-12-21 11:59:47 -08:00
parent c714df0e45
commit 2777ef9456
4 changed files with 1 additions and 28 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ func (f *Forwarder) ServeHTTP(w http.ResponseWriter, req *http.Request) {
return
}
f.log.Infof("Forward to %v, code: %v, duration: %v",
f.log.Infof("Got response from %v, code: %v, duration: %v",
req.URL, response.StatusCode, time.Now().UTC().Sub(start))
utils.CopyHeaders(w.Header(), response.Header)
-1
View File
@@ -241,7 +241,6 @@ func (s *Streamer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
defer b.Close()
s.next.ServeHTTP(b, outreq)
s.log.Infof("next responded: %v", b.code)
reader, err := writer.Reader()
if err != nil {
-1
View File
@@ -83,7 +83,6 @@ func responseCode() toInt {
// IsNetworkError returns a predicate that returns true if last attempt ended with network error.
func isNetworkError() hpredicate {
return func(c *context) bool {
c.log.Infof("code: %v", c.responseCode)
return c.responseCode == http.StatusBadGateway || c.responseCode == http.StatusGatewayTimeout
}
}
-25
View File
@@ -12,10 +12,6 @@ type Logger interface {
Infof(format string, args ...interface{})
Warningf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Info(message string)
Error(message string)
Warning(message string)
}
type FileLogger struct {
@@ -60,27 +56,6 @@ func (f *FileLogger) Errorf(format string, args ...interface{}) {
f.error.Printf(format, args...)
}
func (f *FileLogger) Info(message string) {
if f.info == nil {
return
}
f.info.Print(message)
}
func (f *FileLogger) Warning(message string) {
if f.warn == nil {
return
}
f.warn.Print(message)
}
func (f *FileLogger) Error(message string) {
if f.error == nil {
return
}
f.error.Print(message)
}
type NOPLogger struct {
}