Add logging to file for windows #204
9
main.go
9
main.go
|
@ -37,6 +37,12 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
filelogger, err := log.NewFile(log.LevelInfo, "cwtch_log.txt")
|
||||||
|
if err == nil {
|
||||||
|
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!")
|
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")
|
flagLocal := flag.Bool("local", false, "load user interface from the local folder \"qml\" instead of the built-in UI")
|
||||||
|
@ -54,8 +60,7 @@ func main() {
|
||||||
//log.SetLevel(log.LevelDebug)
|
//log.SetLevel(log.LevelDebug)
|
||||||
//log.ExcludeFromPattern("connection/connection")
|
//log.ExcludeFromPattern("connection/connection")
|
||||||
//log.ExcludeFromPattern("outbound/3dhauthchannel")
|
//log.ExcludeFromPattern("outbound/3dhauthchannel")
|
||||||
//log.ExcludeFromPattern("event/eventmanager")
|
//log.AddNothingExceptFilter("event/eventmanager")
|
||||||
//log.AddNothingExceptFilter("connections/peerserverconnection")
|
|
||||||
|
|
||||||
if os.Getenv("CWTCH_FOLDER") != "" {
|
if os.Getenv("CWTCH_FOLDER") != "" {
|
||||||
the.CwtchDir = os.Getenv("CWTCH_FOLDER")
|
the.CwtchDir = os.Getenv("CWTCH_FOLDER")
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
start "cwtch ui debug mode" ui -debug
|
Reference in New Issue