diff options
| author | Jeff Carr <[email protected]> | 2023-04-26 20:56:25 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-26 20:56:25 -0500 |
| commit | e3cf42f1da9ec0ed07a7f346a0ce9c9ff10295c1 (patch) | |
| tree | 0fe6fe28f11ccb3d1d6a989349071928f4a7ccb9 /toolkit/gocui/log.go | |
| parent | 5b217fa23af4e5040d5f09d9840ddc426a315960 (diff) | |
gocui: log() output works
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/log.go')
| -rw-r--r-- | toolkit/gocui/log.go | 17 |
1 files changed, 11 insertions, 6 deletions
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) } |
