* Converts an RTCP Packet into a human-readable format. The Packets themselves can control the presentation as follows: - Fields of a type that have a String() method will be formatted with that String method (which should not emit '\n' characters) - Otherwise, fields with a tag containing
(p Packet)
| 31 | baseline implementation that works well in the majority of cases. |
| 32 | */ |
| 33 | func stringify(p Packet) string { |
| 34 | value := reflect.Indirect(reflect.ValueOf(p)) |
| 35 | |
| 36 | return formatField(value.Type().String(), "", p, "") |
| 37 | } |
| 38 | |
| 39 | //nolint:gocognit,cyclop |
| 40 | func formatField(name string, format string, f any, indent string) string { |