mirror of
https://github.com/folbricht/routedns.git
synced 2025-12-21 09:29:56 -06:00
move from logrus to slog (#422)
* Migrate from logrus to slog * fully removing logrus * should be working now * Update pipeline.go Co-authored-by: Frank Olbricht <frank.olbricht@gmail.com> * Update response-blocklist-name.go Co-authored-by: Frank Olbricht <frank.olbricht@gmail.com> * added null logger * Update pipeline.go --------- Co-authored-by: Frank Olbricht <frank.olbricht@gmail.com>
This commit is contained in:
13
dnsclient.go
13
dnsclient.go
@@ -6,8 +6,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"log/slog"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// DNSClient represents a simple DNS resolver for UDP or TCP.
|
||||
@@ -65,11 +66,11 @@ func NewDNSClient(id, endpoint, network string, opt DNSClientOptions) (*DNSClien
|
||||
func (d *DNSClient) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {
|
||||
// Packing a message is not always a read-only operation, make a copy
|
||||
q = q.Copy()
|
||||
|
||||
logger(d.id, q, ci).WithFields(logrus.Fields{
|
||||
"resolver": d.endpoint,
|
||||
"protocol": d.net,
|
||||
}).Debug("querying upstream resolver")
|
||||
log := logger(d.id, q, ci)
|
||||
log.Debug("querying upstream resolver",
|
||||
slog.String("resolver", d.endpoint),
|
||||
slog.String("protocol", d.net),
|
||||
)
|
||||
|
||||
q = setUDPSize(q, d.opt.UDPSize)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user