fix logging and crash reports on Windows

"-H=windowsgui" disables stdout on Windows, and the io.Multiwriter used
for logging had stdout as it's first entry, which failed and caused
    logging and line caching to be skipped. stdout is now removed from
    the multiwriter in this situation. Other portion of the issue was
    because crash reports had colons in their names, which Windows
    doesn't like. Fixes #168.
This commit is contained in:
Harvey Tindall
2023-02-02 13:42:15 +00:00
parent a30469f6ec
commit 49c7d83840
3 changed files with 30 additions and 7 deletions
+5 -1
View File
@@ -27,7 +27,11 @@ func logOutput() (closeFunc func(), err error) {
closeFunc = func() {}
return
}
writers = append(writers, colorStripper{f})
if PLATFORM == "windows" {
writers = []io.Writer{colorStripper{lineCache}, colorStripper{f}}
} else {
writers = append(writers, colorStripper{f})
}
closeFunc = func() {
w.Close()
<-wExit