MCPcopy Index your code
hub / github.com/gotenberg/gotenberg / BuildDebug

Function BuildDebug

pkg/gotenberg/debug.go:23–54  ·  view source on GitHub ↗

BuildDebug builds the debug data from modules.

(ctx *Context)

Source from the content-addressed store, hash-verified

21
22// BuildDebug builds the debug data from modules.
23func BuildDebug(ctx *Context) {
24 debugMu.Lock()
25 defer debugMu.Unlock()
26
27 debug = &DebugInfo{
28 Version: Version,
29 Timezone: time.Now().Location().String(),
30 Architecture: runtime.GOARCH,
31 Modules: make([]string, len(ctx.moduleInstances)),
32 ModulesAdditionalData: make(map[string]map[string]any),
33 Flags: make(map[string]any),
34 }
35
36 i := 0
37 for ID, mod := range ctx.moduleInstances {
38 debug.Modules[i] = ID
39 i++
40
41 debuggable, ok := mod.(Debuggable)
42 if !ok {
43 continue
44 }
45
46 debug.ModulesAdditionalData[ID] = debuggable.Debug()
47 }
48
49 sort.Sort(AlphanumericSort(debug.Modules))
50
51 ctx.ParsedFlags().VisitAll(func(f *flag.Flag) {
52 debug.Flags[f.Name] = f.Value.String()
53 })
54}
55
56// Debug returns the debug data.
57func Debug() DebugInfo {

Callers 2

RunFunction · 0.92
TestBuildDebugFunction · 0.85

Calls 4

AlphanumericSortTypeAlias · 0.85
StringMethod · 0.80
ParsedFlagsMethod · 0.80
DebugMethod · 0.65

Tested by 1

TestBuildDebugFunction · 0.68