Proper logging
This commit is contained in:
@@ -82,7 +82,7 @@ func Setup(app *aero.Application, c config.ConfigInterface, t *torrent.TorrentMa
|
||||
filenameV2, linkFragment := davextra.ExtractLinkFragment(filename)
|
||||
link := getLink(torrents, filenameV2, linkFragment)
|
||||
if link == "" {
|
||||
log.Println("Link not found")
|
||||
log.Println("Link not found", filename)
|
||||
return ctx.Error(http.StatusNotFound, "Cannot find file")
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ func Setup(app *aero.Application, c config.ConfigInterface, t *torrent.TorrentMa
|
||||
// TODO: Readd the file
|
||||
// when unrestricting fails, it means the file is not available anymore
|
||||
// if it's the only file, tough luck
|
||||
log.Println("Cannot unrestrict link")
|
||||
log.Println("Cannot unrestrict link", link, filenameV2)
|
||||
return ctx.Error(http.StatusNotFound, "Cannot find file")
|
||||
}
|
||||
if resp.Filename != filenameV2 {
|
||||
|
||||
@@ -42,7 +42,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
filenameV2, linkFragment := davextra.ExtractLinkFragment(filename)
|
||||
link := getLink(torrents, filenameV2, linkFragment)
|
||||
if link == "" {
|
||||
log.Println("Link not found")
|
||||
log.Println("Link not found", filename)
|
||||
http.Error(w, "Cannot find file", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
// TODO: Readd the file
|
||||
// when unrestricting fails, it means the file is not available anymore, but still in their database
|
||||
// if it's the only file, tough luck
|
||||
log.Println("Cannot unrestrict link")
|
||||
log.Println("Cannot unrestrict link", link, filenameV2)
|
||||
http.Error(w, "Cannot find file", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func Router(mux *http.ServeMux, c config.ConfigInterface, t *torrent.TorrentMana
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
default:
|
||||
log.Println("Method not implemented")
|
||||
log.Println("Method not implemented", r.Method)
|
||||
http.Error(w, "Method not implemented", http.StatusMethodNotAllowed)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
func convertRFC3339toRFC1123(input string) string {
|
||||
t, err := time.Parse(time.RFC3339, input)
|
||||
if err != nil {
|
||||
log.Println("Error:", err)
|
||||
log.Println("Conversion error", err)
|
||||
return ""
|
||||
}
|
||||
return t.Format("Mon, 02 Jan 2006 15:04:05 GMT")
|
||||
|
||||
Reference in New Issue
Block a user