MCPcopy
hub / github.com/AdguardTeam/dnsproxy / logDNSMessage

Method logDNSMessage

proxy/server.go:207–220  ·  view source on GitHub ↗

logDNSMessage logs the given DNS message.

(ctx context.Context, m *dns.Msg)

Source from the content-addressed store, hash-verified

205
206// logDNSMessage logs the given DNS message.
207func (p *Proxy) logDNSMessage(ctx context.Context, m *dns.Msg) {
208 if m == nil {
209 return
210 }
211
212 var msg string
213 if m.Response {
214 msg = "out"
215 } else {
216 msg = "in"
217 }
218
219 slogutil.PrintLines(ctx, p.logger, slog.LevelDebug, msg, m.String())
220}
221
222// logWithNonCrit logs the error on the appropriate level depending on whether
223// err is a critical error or not.

Callers 1

handleDNSRequestMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected