Skip to content

Commit

Permalink
fixing log writer closes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
zoli committed Mar 19, 2016
1 parent 962a370 commit 093e38d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package main

import (
"flag"
"runtime"

"gopkg.in/qml.v1"
Expand All @@ -20,13 +21,19 @@ const (
render_chan_len = 2
)

var t *qmlfrontend
var (
t *qmlfrontend

rotateLog = flag.Bool("rotateLog", false, "Rotate debug log")
)

func main() {
flag.Parse()

// Need to lock the OS thread as OSX GUI requires GUI stuff to run in the main thread
runtime.LockOSThread()

log.AddFilter("file", log.DEBUG, log.NewConsoleLogWriter())
log.AddFilter("file", log.FINEST, log.NewFileLogWriter("debug.log", *rotateLog))
defer func() {
py.NewLock()
py.Finalize()
Expand Down

0 comments on commit 093e38d

Please sign in to comment.