summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2018-12-09 21:23:05 -0800
committerCaleb Bassi <calebjbassi@gmail.com>2018-12-09 21:32:12 -0800
commit8548428db4b215048c6f91a5cf71da7ff8274676 (patch)
tree2df35363c9c6c4f24b4208039748036176feade6
parent5de58c6964c811b36e52527f4d17c2d27a6eb343 (diff)
Redirect stderr to logfile
-rw-r--r--main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go
index 556e79a..b03a92b 100644
--- a/main.go
+++ b/main.go
@@ -361,9 +361,11 @@ func logging() *os.File {
}
func main() {
- defer logging().Close()
+ lf := logging()
+ defer lf.Close()
cliArguments()
- termuiColors() // need to do this before initializing widgets so that they can inherit the colors
+ syscall.Dup2(int(lf.Fd()), 2) // redirect stderr to logfile
+ termuiColors() // need to do this before initializing widgets so that they can inherit the colors
initWidgets()
widgetColors()
help = w.NewHelpMenu()