summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-31 12:08:13 -0600
committerJeff Carr <[email protected]>2025-01-31 13:47:45 -0600
commit5b39848b6448c8b95764bd42146e4e13b469876e (patch)
tree358aa0540d159ea4233e82977c656afb874d1162 /debug.go
parentbbdf7fefbd9d812b4db575a57d9d159d68921f7f (diff)
more helpful and easier to read debugging output
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/debug.go b/debug.go
index 7fa8561..3951147 100644
--- a/debug.go
+++ b/debug.go
@@ -8,9 +8,9 @@ import (
)
func (w *guiWidget) dumpTree(s string) {
- // log.Log(ERROR, "dumpTree w", w.node.WidgetId, w.WidgetType, w.String())
+ // log.Log(ERROR, "dump w", w.node.WidgetId, w.WidgetType, w.String())
if w == nil {
- log.Log(ERROR, "dumpTree w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
+ log.Log(ERROR, "dump w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
return
}
w.showWidgetPlacement("dumpTree() " + s)
@@ -29,27 +29,29 @@ func (w *guiWidget) showWidgetPlacement(s string) {
} else {
pId = w.node.Parent.WidgetId
}
- s1 = fmt.Sprintf("(wId,pId)=(%2d,%2d) ", w.node.WidgetId, pId)
+ s1 = fmt.Sprintf("(wId,pId)=(%4d,%4d) ", w.node.WidgetId, pId)
sizeW, sizeH := w.Size()
- s1 += fmt.Sprintf("size=(%2d,%2d)", sizeW, sizeH)
+ s1 += fmt.Sprintf("size=(%3d,%3d)", sizeW, sizeH)
if w.Visible() {
- s1 += fmt.Sprintf("gocui=(%2d,%2d,%2d,%2d)",
+ s1 += fmt.Sprintf("gocui=(%3d,%3d,%3d,%3d)",
w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
} else {
- s1 += fmt.Sprintf(" %2s %2s %2s %2s ", "", "", "", "")
+ s1 += fmt.Sprintf(" %3s %3s %3s %3s ", "", "", "", "")
}
if w.node.Parent != nil {
if w.node.Parent.WidgetType == widget.Grid {
- s1 += fmt.Sprintf("At(%2d,%2d) ", w.node.State.AtW, w.node.State.AtH)
+ s1 += fmt.Sprintf("At(%3d,%3d) ", w.node.State.AtW, w.node.State.AtH)
} else {
- s1 += fmt.Sprintf(" %2s %2s ", "", "")
+ s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
} else {
- s1 += fmt.Sprintf(" %2s %2s ", "", "")
+ s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
- tmp := "." + w.String() + ". " + w.cuiName
+ var end string
if w.node.WidgetType == widget.Box {
- tmp = "." + w.node.State.Direction.String() + ". " + w.cuiName
+ end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.node.State.Direction.String())
+ } else {
+ end = fmt.Sprintf("%5s %-8s %s", w.cuiName, w.node.WidgetType, w.String())
}
- log.Log(NOW, s1, s, w.node.WidgetType, ",", tmp) //
+ log.Log(NOW, s1, s, end)
}