mirror of
https://github.com/folbricht/routedns.git
synced 2025-12-17 15:45:21 -06:00
* 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>
21 lines
482 B
Go
21 lines
482 B
Go
package rdns
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
// Log is a package-global logger used throughout the library. Configuration can be
|
|
// changed directly on this instance or the instance replaced.
|
|
var Log = slog.Default()
|
|
|
|
func logger(id string, q *dns.Msg, ci ClientInfo) *slog.Logger {
|
|
return Log.With(
|
|
slog.String("id", id),
|
|
slog.Any("client", ci.SourceIP),
|
|
slog.String("qtype", dns.Type(q.Question[0].Qtype).String()),
|
|
slog.String("qname", qName(q)),
|
|
)
|
|
}
|