logging: Don't use PrintF when not needed (#1599)

These log print don't have any verbs, so just use plain Print
This commit is contained in:
Miek Gieben 2018-03-09 20:42:27 +00:00 committed by GitHub
parent 87790dd47c
commit 27f58d8dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View file

@ -177,7 +177,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key int, mt response.Type, duration tim
// Write implements the dns.ResponseWriter interface. // Write implements the dns.ResponseWriter interface.
func (w *ResponseWriter) Write(buf []byte) (int, error) { func (w *ResponseWriter) Write(buf []byte) (int, error) {
log.Printf("[WARNING] Caching called with Write: not caching reply") log.Print("[WARNING] Caching called with Write: not caching reply")
if w.prefetch { if w.prefetch {
return 0, nil return 0, nil
} }

View file

@ -40,7 +40,7 @@ func (d *ResponseWriter) WriteMsg(res *dns.Msg) error {
// Write implements the dns.ResponseWriter interface. // Write implements the dns.ResponseWriter interface.
func (d *ResponseWriter) Write(buf []byte) (int, error) { func (d *ResponseWriter) Write(buf []byte) (int, error) {
log.Printf("[WARNING] Dnssec called with Write: not signing reply") log.Print("[WARNING] Dnssec called with Write: not signing reply")
n, err := d.ResponseWriter.Write(buf) n, err := d.ResponseWriter.Write(buf)
return n, err return n, err
} }

View file

@ -70,7 +70,7 @@ func (dio *dnstapIO) newConnect() error {
// Connect connects to the dnstop endpoint. // Connect connects to the dnstop endpoint.
func (dio *dnstapIO) Connect() { func (dio *dnstapIO) Connect() {
if err := dio.newConnect(); err != nil { if err := dio.newConnect(); err != nil {
log.Printf("[ERROR] No connection to dnstap endpoint") log.Print("[ERROR] No connection to dnstap endpoint")
} }
go dio.serve() go dio.serve()
} }
@ -102,7 +102,7 @@ func (dio *dnstapIO) flushBuffer() {
if err := dio.newConnect(); err != nil { if err := dio.newConnect(); err != nil {
return return
} }
log.Printf("[INFO] Reconnected to dnstap") log.Print("[INFO] Reconnected to dnstap")
} }
if err := dio.enc.flushBuffer(); err != nil { if err := dio.enc.flushBuffer(); err != nil {
@ -111,7 +111,7 @@ func (dio *dnstapIO) flushBuffer() {
if err := dio.newConnect(); err != nil { if err := dio.newConnect(); err != nil {
log.Printf("[ERROR] Cannot connect to dnstap: %s", err) log.Printf("[ERROR] Cannot connect to dnstap: %s", err)
} else { } else {
log.Printf("[INFO] Reconnected to dnstap") log.Print("[INFO] Reconnected to dnstap")
} }
} }
} }

View file

@ -53,7 +53,7 @@ func notify(zone string, to []string) error {
continue continue
} }
if err := notifyAddr(c, m, t); err != nil { if err := notifyAddr(c, m, t); err != nil {
log.Printf("[ERROR] " + err.Error()) log.Print("[ERROR] " + err.Error())
} else { } else {
log.Printf("[INFO] Sent notify for zone %q to %q", zone, t) log.Printf("[INFO] Sent notify for zone %q to %q", zone, t)
} }

View file

@ -33,7 +33,7 @@ func (p *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
} }
hj, ok := w.(http.Hijacker) hj, ok := w.(http.Hijacker)
if !ok { if !ok {
log.Printf("[ERROR] Unable to establish connection: no hijacker") log.Print("[ERROR] Unable to establish connection: no hijacker")
http.Error(w, "Unable to establish connection: no hijacker", 500) http.Error(w, "Unable to establish connection: no hijacker", 500)
return return
} }

View file

@ -75,7 +75,7 @@ func roundRobinShuffle(records []dns.RR) {
// Write implements the dns.ResponseWriter interface. // Write implements the dns.ResponseWriter interface.
func (r *RoundRobinResponseWriter) Write(buf []byte) (int, error) { func (r *RoundRobinResponseWriter) Write(buf []byte) (int, error) {
// Should we pack and unpack here to fiddle with the packet... Not likely. // Should we pack and unpack here to fiddle with the packet... Not likely.
log.Printf("[WARNING] RoundRobin called with Write: no shuffling records") log.Print("[WARNING] RoundRobin called with Write: no shuffling records")
n, err := r.ResponseWriter.Write(buf) n, err := r.ResponseWriter.Write(buf)
return n, err return n, err
} }