mirror of
https://github.com/folbricht/routedns.git
synced 2026-01-10 03:30:08 -06:00
20 lines
476 B
Go
20 lines
476 B
Go
package rdns
|
|
|
|
import (
|
|
"github.com/miekg/dns"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// Log is a package-global logger used throughout the library. Configuration can be
|
|
// changed directly on this instance or the instance replaced.
|
|
var Log = logrus.New()
|
|
|
|
func logger(id string, q *dns.Msg, ci ClientInfo) *logrus.Entry {
|
|
return Log.WithFields(logrus.Fields{
|
|
"id": id,
|
|
"client": ci.SourceIP,
|
|
"qtype": dns.Type(q.Question[0].Qtype).String(),
|
|
"qname": qName(q),
|
|
})
|
|
}
|