Skip to content

Commit

Permalink
Use log instead of fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dethancosta committed Feb 21, 2024
1 parent d02ebda commit 49fdae0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cmd/tr-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func main() {
flag.Parse()
portStr := strconv.Itoa(port)
s.Ntfy = NtfyId
log.Printf("ntfyid: %s", NtfyId) //TODO delete
log.Printf("s.ntfy: %s", s.Ntfy) //TODO delete
log.Printf("standalone: %t", standalone) //TODO delete

if standalone {
err := SetPid(Address, portStr)
Expand Down
8 changes: 4 additions & 4 deletions cmd/tr-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *Server) GetSchedule(w http.ResponseWriter, r *http.Request) {
return
}
// TODO delete this line
fmt.Println("ntfy sent")
log.Println("ntfy sent")
}
}
w.Header().Set("Content-Type", "application/json")
Expand Down Expand Up @@ -103,7 +103,7 @@ func (s *Server) GetCurrentTask(w http.ResponseWriter, r *http.Request) {
return
}
// TODO delete this line
fmt.Println("ntfy sent")
log.Println("ntfy sent")
}
}
msg, err := json.Marshal(map[string]struct {
Expand Down Expand Up @@ -164,7 +164,7 @@ func (s *Server) ChangeCurrentTask(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
fmt.Println("ntfy sent")
log.Println("ntfy sent")
}
w.WriteHeader(http.StatusOK)
}
Expand Down Expand Up @@ -262,7 +262,7 @@ func (s *Server) BuildSchedule(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
fmt.Println("ntfy sent")
log.Println("ntfy sent")
}

w.WriteHeader(http.StatusOK)
Expand Down
Binary file added tr-server
Binary file not shown.

0 comments on commit 49fdae0

Please sign in to comment.