mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
pkg/log: fix data race on d (#2698)
* pkg/log: fix data race on d Wrap d in a mutex to prevent data race. This makes is slower, but this is a debugging aid anyway. It's not used normally. Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests compilation Signed-off-by: Miek Gieben <miek@miek.nl> * Fix test compile Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
//
|
||||
// msg will prefix the pcap dump.
|
||||
func Hexdump(m *dns.Msg, v ...interface{}) {
|
||||
if !log.D {
|
||||
if !log.D.Value() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func Hexdump(m *dns.Msg, v ...interface{}) {
|
||||
|
||||
// Hexdumpf dumps a DNS message as Hexdump, but allows a format string.
|
||||
func Hexdumpf(m *dns.Msg, format string, v ...interface{}) {
|
||||
if !log.D {
|
||||
if !log.D.Value() {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user