wip: migrate to mono-repo. SPN has already been moved to spn/
This commit is contained in:
30
service/compat/debug_windows.go
Normal file
30
service/compat/debug_windows.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package compat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/safing/portbase/utils/debug"
|
||||
)
|
||||
|
||||
// AddToDebugInfo adds compatibility data to the given debug.Info.
|
||||
func AddToDebugInfo(di *debug.Info) {
|
||||
// Get WFP state and add error info if it fails.
|
||||
wfp, err := GetWFPState()
|
||||
if err != nil {
|
||||
di.AddSection(
|
||||
"Compatibility: WFP State (failed)",
|
||||
debug.UseCodeSection,
|
||||
err.Error(),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Add data as section.
|
||||
wfpTable := wfp.AsTable()
|
||||
di.AddSection(
|
||||
fmt.Sprintf("Compatibility: WFP State (%d)", strings.Count(wfpTable, "\n")),
|
||||
debug.UseCodeSection,
|
||||
wfpTable,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user