dan
/
ui
forked from cwtch.im/ui
1
0
Fork 0

allow cwtch to log to file

logFlag
Dan Ballard 2 years ago
parent c11e541f4e
commit 568b979698
  1. 11
      main.go

@ -54,16 +54,21 @@ func main() {
event.NewGetValMessageFromPeer,
}
logfileDefault := ""
if runtime.GOOS == "windows" {
logfileDefault = "cwtch_log.txt"
}
flagDebug := flag.Bool("debug", false, "turn on extra logging. WARNING: THIS MAY EXPOSE PRIVATE INFORMATION IN CONSOLE OUTPUT!")
flagLogFile := flag.String("logfile", logfileDefault, "specify a file name to log to. --console overrides")
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 *flagLogFile != "" && !*flagConsole {
filelogger, err := log.NewFile(log.LevelInfo, *flagLogFile)
if err == nil {
log.SetStd(filelogger)
}
@ -305,7 +310,7 @@ func loadNetworkingAndFiles(gcd *ui.GrandCentralDispatcher, service bool, client
}
loadACN()
pid,err := the.ACN.GetPID()
pid, err := the.ACN.GetPID()
if err == nil {
gcd.GlobalSettings.PreviousPid = int64(pid)
ui.WriteGlobalSettings(gcd.GlobalSettings)

Loading…
Cancel
Save