feat: add function to log libdns.Records
This commit is contained in:
parent
46d64b2ca8
commit
a6d39a06aa
1 changed files with 16 additions and 0 deletions
16
log.go
16
log.go
|
|
@ -206,3 +206,19 @@ func log_RR(enc zapcore.ObjectEncoder, rr dns.RR) {
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func log_libdns_record(record *libdns.Record) zapcore.ObjectMarshaler {
|
||||||
|
f := func(enc zapcore.ObjectEncoder) error {
|
||||||
|
enc.AddString("ID", record.ID)
|
||||||
|
enc.AddString("type", record.Type)
|
||||||
|
enc.AddString("name", record.Name)
|
||||||
|
enc.AddString("value", record.Value)
|
||||||
|
enc.AddString("TTL", record.TTL.String())
|
||||||
|
if record.Priority != 0 {
|
||||||
|
enc.AddInt("priority", record.Priority)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return zapcore.ObjectMarshalerFunc(f)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue