mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
pkg/log: ability for debug logs (#1689)
* pkg/log: ability for debug logs When the debug plugin is enabled all log.Debug calls will print to standard; if not there are a noop (almost). The log package wraps some standard log functions as well, so just replacing "log" with "plugin/pkg/log" should be enough to use this package. * docs * Add docs * lint * Test fallthrough to log pkg as well * simple package - up test coverage * add other log levels as well * update docs
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/coredns/coredns/plugin"
|
||||
"github.com/coredns/coredns/plugin/metrics/vars"
|
||||
"github.com/coredns/coredns/plugin/pkg/edns"
|
||||
"github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/plugin/pkg/rcode"
|
||||
"github.com/coredns/coredns/plugin/pkg/trace"
|
||||
"github.com/coredns/coredns/request"
|
||||
@@ -60,6 +61,7 @@ func NewServer(addr string, group []*Config) (*Server, error) {
|
||||
for _, site := range group {
|
||||
if site.Debug {
|
||||
s.debug = true
|
||||
log.D = true
|
||||
}
|
||||
// set the config per zone
|
||||
s.zones[site.Zone] = site
|
||||
|
||||
Reference in New Issue
Block a user