Пример #1
0
func main() {
	flag.Parse()

	log.AddFilter("file", log.FINEST, log.NewFileLogWriter("debug.log", *rotateLog))
	// Replace Global Logger filter so that it does not interfere with the ui
	log.AddFilter("stdout", log.DEBUG, log.NewFileLogWriter("debug.log", *rotateLog))

	defer func() {
		py.NewLock()
		py.Finalize()
	}()

	if err := termbox.Init(); err != nil {
		log.Error(err)
		log.Close()
		return
	}

	defer func() {
		termbox.Close()
		log.Debug(util.Prof)
		if err := recover(); err != nil {
			log.Critical(err)
			panic(err)
		}
	}()

	t := createFrontend()
	t.editor.Init()
	go t.renderthread()
	t.loop()
}
Пример #2
0
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.FINEST, log.NewFileLogWriter("debug.log", *rotateLog))
	defer func() {
		py.NewLock()
		py.Finalize()
	}()

	initFrontend()
}