diff --git a/main.go b/main.go index c78c6020..5ecf927c 100644 --- a/main.go +++ b/main.go @@ -52,18 +52,21 @@ func main() { event.NewGetValMessageFromPeer, } - if runtime.GOOS == "windows" { + + flagDebug := flag.Bool("debug", false, "turn on extra logging. WARNING: THIS MAY EXPOSE PRIVATE INFORMATION IN CONSOLE OUTPUT!") + flagLocal := flag.Bool("local", false, "load user interface from the local folder \"qml\" instead of the built-in UI") + flagService := flag.Bool("service", false, "run this process as an android service") + flagClientUI := flag.Bool("clientui", false, "start the UI as a client of a service app instead of a full app") + flagConsole := flag.Bool("console", false, "on windows, force logging to console instead of file") + flag.Parse() + + if runtime.GOOS == "windows" && !*flagConsole { filelogger, err := log.NewFile(log.LevelInfo, "cwtch_log.txt") if err == nil { log.SetStd(filelogger) } } log.Infoln("ui main()\n") - flagDebug := flag.Bool("debug", false, "turn on extra logging. WARNING: THIS MAY EXPOSE PRIVATE INFORMATION IN CONSOLE OUTPUT!") - flagLocal := flag.Bool("local", false, "load user interface from the local folder \"qml\" instead of the built-in UI") - flagService := flag.Bool("service", false, "run this process as an android service") - flagClientUI := flag.Bool("clientui", false, "start the UI as a client of a service app instead of a full app") - flag.Parse() if *flagDebug { log.SetLevel(log.LevelDebug)