Merge pull request 'add flag to force windows to log to console' (#352) from consoleFlag into master
the build was successful
Details
the build was successful
Details
Reviewed-on: #352
This commit is contained in:
commit
ada9dc7bb9
15
main.go
15
main.go
|
@ -52,18 +52,21 @@ func main() {
|
||||||
event.NewGetValMessageFromPeer,
|
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")
|
filelogger, err := log.NewFile(log.LevelInfo, "cwtch_log.txt")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.SetStd(filelogger)
|
log.SetStd(filelogger)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Infoln("ui main()\n")
|
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 {
|
if *flagDebug {
|
||||||
log.SetLevel(log.LevelDebug)
|
log.SetLevel(log.LevelDebug)
|
||||||
|
|
Reference in New Issue