Skip to content

Add logging to find out what's going wrong #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func checkCmd(m []byte) {
} else if strings.HasPrefix(sl, "broadcast") {
go broadcast(s)
} else if strings.HasPrefix(sl, "restart") {
log.Println("Received restart from the daemon. Why? Boh")
restart("")
} else if strings.HasPrefix(sl, "exit") {
exit()
Expand Down Expand Up @@ -266,6 +267,7 @@ func exit() {
}

func restart(path string) {
log.Println("called restart", path)
// relaunch ourself and exit
// the relaunch works because we pass a cmdline in
// that has serial-port-json-server only initialize 5 seconds later
Expand Down
3 changes: 3 additions & 0 deletions trayicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func addRebootTrayElement() {
<-reboot_tray.ClickedCh
systray.Quit()
log.Println("Restarting now...")
log.Println("Restart because addReebotTrayElement")
restart("")
}()
}
Expand All @@ -78,6 +79,7 @@ func setupSysTrayReal() {
}
systray.Quit()
*hibernate = true
log.Println("Restart becayse setup went wrong?")
restart("")
}()

Expand Down Expand Up @@ -113,6 +115,7 @@ func setupSysTrayHibernate() {
go func() {
<-mOpen.ClickedCh
*hibernate = false
log.Println("Restart for hubernation")
restart("")
}()

Expand Down
2 changes: 2 additions & 0 deletions update.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ func (u *Updater) update() error {
//shutil.CopyFile(*configIni, *configIni+".bak", false)
//os.Remove(*configIni)

log.Println("Restarting because update!")

restart(path)
//addRebootTrayElement()

Expand Down