aboutsummaryrefslogtreecommitdiff
path: root/lib/dns
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns')
-rw-r--r--lib/dns/server.go4
-rw-r--r--lib/dns/server_options.go18
2 files changed, 7 insertions, 15 deletions
diff --git a/lib/dns/server.go b/lib/dns/server.go
index f834a38b..e4dcbac5 100644
--- a/lib/dns/server.go
+++ b/lib/dns/server.go
@@ -557,9 +557,7 @@ func (srv *Server) serveTCPClient(logp string, cl *TCPClient, kind string) {
func (srv *Server) isImplemented(msg *Message) bool {
switch msg.Question.Class {
case RecordClassCH, RecordClassHS:
- if srv.opts.Debug&DebugLevelDNS != 0 {
- log.Printf(`dns: class %d is not implemented`, msg.Question.Class)
- }
+ log.Printf(`dns: class %d is not implemented`, msg.Question.Class)
return false
}
diff --git a/lib/dns/server_options.go b/lib/dns/server_options.go
index 9c042b5a..d53b1abd 100644
--- a/lib/dns/server_options.go
+++ b/lib/dns/server_options.go
@@ -14,21 +14,15 @@ import (
libnet "git.sr.ht/~shulhan/pakakeh.go/lib/net"
)
-// List of [ServerOptions] Debug mode.
-// For example, to log DNS error and cache operations, set the Debug value
-// to 3 or (DebugLevelDNS|DebugLevelCache).
+// List of [ServerOptions.Debug] mode.
const (
- // Log error on DNS level, in example EMPTY answer, ERR_NAME,
- // ERR_NOT_IMPLEMENTED, ERR_REFUSED.
- DebugLevelDNS = 1
-
- // Log cache operations, including new record, updating records,
- // and pruning record in caches.
- DebugLevelCache = 2
+ // Log cache operations, including insert, update, and deleting
+ // record into/from caches.
+ DebugLevelCache = 1
// Log low level DNS connection and packet, including request and
// response.
- DebugLevelConnPacket = 4
+ DebugLevelConnPacket = 2
)
// HookFunc define type function that will be triggered on specific event.
@@ -109,7 +103,7 @@ type ServerOptions struct {
// accessed in the last 1 minute will be removed from cache.
PruneThreshold time.Duration `ini:"dns:server:cache.prune_threshold"`
- // Debug level for server, accept value [DebugLevelDNS],
+ // Debug level for server, accept value
// [DebugLevelCache], [DebugLevelConnPacket], or any combination of
// it.
Debug int `ini:"dns:server:debug"`