forked from u2takey/ffmpeg-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.go
43 lines (39 loc) · 807 Bytes
/
debug.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// +build debug
package ffmpeg_go
import (
"fmt"
"log"
"strings"
)
func DebugNodes(node []DagNode) {
b := strings.Builder{}
for _, n := range node {
b.WriteString(fmt.Sprintf("%s\n", n.String()))
}
log.Println(b.String())
}
func DebugOutGoingMap(node []DagNode, m map[int]map[Label][]NodeInfo) {
b := strings.Builder{}
h := map[int]DagNode{}
for _, n := range node {
h[n.Hash()] = n
}
for k, v := range m {
b.WriteString(fmt.Sprintf("[Key]: %s", h[k].String()))
b.WriteString(" [Value]: {")
for l, mm := range v {
if l == "" {
l = "None"
}
b.WriteString(fmt.Sprintf("%s: [", l))
for _, x := range mm {
b.WriteString(x.Node.String())
b.WriteString(", ")
}
b.WriteString("]")
}
b.WriteString("}")
b.WriteString("\n")
}
log.Println(b.String())
}