MCPcopy
hub / github.com/safing/portmaster / AddToDebugInfo

Function AddToDebugInfo

service/compat/debug_linux.go:10–28  ·  view source on GitHub ↗

AddToDebugInfo adds compatibility data to the given debug.Info.

(di *debug.Info)

Source from the content-addressed store, hash-verified

8
9// AddToDebugInfo adds compatibility data to the given debug.Info.
10func AddToDebugInfo(di *debug.Info) {
11 // Get iptables state and add error info if it fails.
12 chains, err := GetIPTablesChains()
13 if err != nil {
14 di.AddSection(
15 "Compatibility: IPTables Chains (failed)",
16 debug.UseCodeSection,
17 err.Error(),
18 )
19 return
20 }
21
22 // Add data as section.
23 di.AddSection(
24 fmt.Sprintf("Compatibility: IPTables Chains (%d)", len(chains)-10),
25 debug.UseCodeSection|debug.AddContentLineBreaks,
26 chains...,
27 )
28}

Callers

nothing calls this directly

Calls 3

GetIPTablesChainsFunction · 0.85
AddSectionMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected