diff options
| author | Jeff Carr <[email protected]> | 2024-01-08 20:52:10 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-08 20:52:10 -0600 |
| commit | 3c2da3f096a5e8aeaa657deb2dc047cc23118c99 (patch) | |
| tree | 9be876900a02aebed4540f5453759ea1f1d5c7ce /gocui/gocui.go | |
| parent | 2a9724d7a89733db8c41571a8b5d9d0e1f0d76b3 (diff) | |
use "go.wit.com/log"
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gocui/gocui.go')
| -rw-r--r-- | gocui/gocui.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gocui/gocui.go b/gocui/gocui.go index d2877d7..1c2e8f7 100644 --- a/gocui/gocui.go +++ b/gocui/gocui.go @@ -7,6 +7,8 @@ package main import ( "errors" "github.com/awesome-gocui/gocui" + + "go.wit.com/log" ) // This initializes the gocui package @@ -47,21 +49,21 @@ func gocuiMain() { func gocuiEvent(g *gocui.Gui) error { maxX, maxY := g.Size() mx, my := g.MousePosition() - log(logVerbose, "handleEvent() START", maxX, maxY, mx, my, msgMouseDown) + log.Log(NOW, "handleEvent() START", maxX, maxY, mx, my, msgMouseDown) if _, err := g.View("msg"); msgMouseDown && err == nil { moveMsg(g) } if widgetView, _ := g.View("msg"); widgetView == nil { - log(logNow, "handleEvent() create output widget now", maxX, maxY, mx, my) + log.Log(NOW, "handleEvent() create output widget now", maxX, maxY, mx, my) makeOutputWidget(g, "this is a create before a mouse click") if (me.logStdout != nil) { // setOutput(me.logStdout) } } else { - log(logInfo, "output widget already exists", maxX, maxY, mx, my) + log.Log(INFO, "output widget already exists", maxX, maxY, mx, my) } mouseMove(g) - log(logVerbose, "handleEvent() END ", maxX, maxY, mx, my, msgMouseDown) + log.Log(INFO, "handleEvent() END ", maxX, maxY, mx, my, msgMouseDown) return nil } @@ -74,7 +76,7 @@ func setFrame(b bool) { // what is this do? I made it just 2 lines for now. Is this useful for something? v := SetView("global", 5, 10, 5, 10, 0) // x0, x1, y1, y2, overlap if (v == nil) { - log(logError, "setFrame() global failed") + log.Log(ERROR, "setFrame() global failed") } v.Frame = b } @@ -85,14 +87,14 @@ func quit(g *gocui.Gui, v *gocui.View) error { func SetView(name string, x0, y0, x1, y1 int, overlaps byte) *gocui.View { if (me.baseGui == nil) { - log(logError, "SetView() ERROR: me.baseGui == nil") + log.Log(ERROR, "SetView() ERROR: me.baseGui == nil") return nil } v, err := me.baseGui.SetView(name, x0, y0, x1, y1, overlaps) if err != nil { if !errors.Is(err, gocui.ErrUnknownView) { - log(logError, "SetView() global failed on name =", name) + log.Log(ERROR, "SetView() global failed on name =", name) } return nil } |
