Improve debug info order
This commit is contained in:
@@ -9,12 +9,15 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/safing/portbase/api"
|
||||
"github.com/safing/portbase/config"
|
||||
"github.com/safing/portbase/database/query"
|
||||
"github.com/safing/portbase/utils/debug"
|
||||
"github.com/safing/portmaster/compat"
|
||||
"github.com/safing/portmaster/network/state"
|
||||
"github.com/safing/portmaster/process"
|
||||
"github.com/safing/portmaster/resolver"
|
||||
"github.com/safing/portmaster/status"
|
||||
"github.com/safing/portmaster/updates"
|
||||
)
|
||||
|
||||
func registerAPIEndpoints() error {
|
||||
@@ -72,17 +75,31 @@ func debugInfo(ar *api.Request) (data []byte, err error) {
|
||||
di.Style = ar.Request.URL.Query().Get("style")
|
||||
|
||||
// Add debug information.
|
||||
|
||||
// Very basic information at the start.
|
||||
di.AddVersionInfo()
|
||||
di.AddPlatformInfo(ar.Context())
|
||||
status.AddToDebugInfo(di)
|
||||
resolver.AddToDebugInfo(di)
|
||||
|
||||
// Errors and unexpected logs.
|
||||
di.AddLastReportedModuleError()
|
||||
di.AddLastUnexpectedLogs()
|
||||
|
||||
// Network Connections.
|
||||
AddNetworkDebugData(
|
||||
di,
|
||||
ar.Request.URL.Query().Get("profile"),
|
||||
ar.Request.URL.Query().Get("where"),
|
||||
)
|
||||
di.AddLastReportedModuleError()
|
||||
di.AddLastUnexpectedLogs()
|
||||
|
||||
// Status Information from various modules.
|
||||
status.AddToDebugInfo(di)
|
||||
// captain.AddToDebugInfo(di) // TODO: Cannot use due to import loop.
|
||||
resolver.AddToDebugInfo(di)
|
||||
config.AddToDebugInfo(di)
|
||||
|
||||
// Detailed information.
|
||||
updates.AddToDebugInfo(di)
|
||||
compat.AddToDebugInfo(di)
|
||||
di.AddGoroutineStack()
|
||||
|
||||
// Return data.
|
||||
|
||||
Reference in New Issue
Block a user