Merge pull request 'add flag to force windows to log to console' (#352) from consoleFlag into master
the build was successful Details

Reviewed-on: #352
This commit is contained in:
Sarah Jamie Lewis 2020-10-28 12:20:33 -07:00
commit ada9dc7bb9
1 changed files with 9 additions and 6 deletions

15
main.go
View File

@ -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)