mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-28 13:48:53 +08:00
41 lines
536 B
Go
41 lines
536 B
Go
// Copyright (C) 2020 Raziman
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
"path"
|
|
|
|
"github.com/rivo/tview"
|
|
)
|
|
|
|
func main() {
|
|
|
|
os.Setenv("TEST", "false")
|
|
|
|
readConfig()
|
|
|
|
app := tview.NewApplication()
|
|
|
|
start(app)
|
|
|
|
}
|
|
|
|
func init() {
|
|
tmpDir := os.TempDir()
|
|
|
|
logFile := path.Join(tmpDir, "gomu.log")
|
|
|
|
file, err := os.OpenFile(logFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
|
|
|
if err != nil {
|
|
log.Fatalf("Error opening file %s", logFile)
|
|
}
|
|
|
|
defer file.Close()
|
|
|
|
log.SetOutput(file)
|
|
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
|
|
}
|