Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
27f58d8d
Commit
27f58d8d
authored
Mar 09, 2018
by
Miek Gieben
Committed by
GitHub
Mar 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging: Don't use PrintF when not needed (#1599)
These log print don't have any verbs, so just use plain Print
parent
87790dd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
plugin/cache/cache.go
plugin/cache/cache.go
+1
-1
plugin/dnssec/responsewriter.go
plugin/dnssec/responsewriter.go
+1
-1
plugin/dnstap/dnstapio/io.go
plugin/dnstap/dnstapio/io.go
+3
-3
plugin/file/notify.go
plugin/file/notify.go
+1
-1
plugin/kubernetes/apiproxy.go
plugin/kubernetes/apiproxy.go
+1
-1
plugin/loadbalance/loadbalance.go
plugin/loadbalance/loadbalance.go
+1
-1
No files found.
plugin/cache/cache.go
View file @
27f58d8d
...
@@ -177,7 +177,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key int, mt response.Type, duration tim
...
@@ -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
.
Print
f
(
"[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
}
}
...
...
plugin/dnssec/responsewriter.go
View file @
27f58d8d
...
@@ -40,7 +40,7 @@ func (d *ResponseWriter) WriteMsg(res *dns.Msg) error {
...
@@ -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
.
Print
f
(
"[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
}
}
...
...
plugin/dnstap/dnstapio/io.go
View file @
27f58d8d
...
@@ -70,7 +70,7 @@ func (dio *dnstapIO) newConnect() error {
...
@@ -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
.
Print
f
(
"[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() {
...
@@ -102,7 +102,7 @@ func (dio *dnstapIO) flushBuffer() {
if
err
:=
dio
.
newConnect
();
err
!=
nil
{
if
err
:=
dio
.
newConnect
();
err
!=
nil
{
return
return
}
}
log
.
Print
f
(
"[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() {
...
@@ -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
.
Print
f
(
"[INFO] Reconnected to dnstap"
)
log
.
Print
(
"[INFO] Reconnected to dnstap"
)
}
}
}
}
}
}
...
...
plugin/file/notify.go
View file @
27f58d8d
...
@@ -53,7 +53,7 @@ func notify(zone string, to []string) error {
...
@@ -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
.
Print
f
(
"[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
)
}
}
...
...
plugin/kubernetes/apiproxy.go
View file @
27f58d8d
...
@@ -33,7 +33,7 @@ func (p *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
...
@@ -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
.
Print
f
(
"[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
}
}
...
...
plugin/loadbalance/loadbalance.go
View file @
27f58d8d
...
@@ -75,7 +75,7 @@ func roundRobinShuffle(records []dns.RR) {
...
@@ -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
.
Print
f
(
"[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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment