From 7006281da1053661a50acec0bcb9aa94cbbcf199 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 24 Apr 2023 08:30:40 -0500 Subject: hack some output. grab STDOUT damnit Signed-off-by: Jeff Carr --- toolkit/gocui/log.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'toolkit/gocui/log.go') diff --git a/toolkit/gocui/log.go b/toolkit/gocui/log.go index b649eb9..e818814 100644 --- a/toolkit/gocui/log.go +++ b/toolkit/gocui/log.go @@ -19,6 +19,17 @@ var outputS []string func log(a ...any) { witlog.Where = "wit/gocui" witlog.Log(a...) +} + +func sleep(a ...any) { + witlog.Sleep(a...) +} + +func exit(a ...any) { + witlog.Exit(a...) +} + +func newLog(a ...any) { s := fmt.Sprint(a...) tmp := strings.Split(s, "\n") outputS = append(outputS, tmp...) @@ -34,14 +45,7 @@ func log(a ...any) { } } -func sleep(a ...any) { - witlog.Sleep(a...) -} - -func exit(a ...any) { - witlog.Exit(a...) -} - func setOutput(f *os.File) { witlog.SetOutput(f) + witlog.SetToolkitOutput(newLog) } -- cgit v1.2.3