From e3cf42f1da9ec0ed07a7f346a0ce9c9ff10295c1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 26 Apr 2023 20:56:25 -0500 Subject: gocui: log() output works Signed-off-by: Jeff Carr --- toolkit/gocui/log.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'toolkit/gocui/log.go') diff --git a/toolkit/gocui/log.go b/toolkit/gocui/log.go index e818814..baf57d9 100644 --- a/toolkit/gocui/log.go +++ b/toolkit/gocui/log.go @@ -1,9 +1,9 @@ package main import ( - "fmt" - "os" - "strings" + "io" +// "fmt" +// "strings" witlog "git.wit.org/wit/gui/log" ) @@ -29,6 +29,7 @@ func exit(a ...any) { witlog.Exit(a...) } +/* func newLog(a ...any) { s := fmt.Sprint(a...) tmp := strings.Split(s, "\n") @@ -44,8 +45,12 @@ func newLog(a ...any) { } } } +*/ -func setOutput(f *os.File) { - witlog.SetOutput(f) - witlog.SetToolkitOutput(newLog) +func setOutput(w io.Writer) { + if (w == nil) { + return + } + witlog.SetOutput(w) + // witlog.SetToolkitOutput(newLog) } -- cgit v1.2.3