Skip to content

Commit

Permalink
Add logs for download converted files
Browse files Browse the repository at this point in the history
  • Loading branch information
shemanaev committed Jan 30, 2024
1 parent 8a560d2 commit 83bdef2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/server/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (h *DownloadHandler) DownloadConverted(w http.ResponseWriter, r *http.Reque
}
defer os.Remove(outFilename)

log.Printf("Serving converted file from: %s", outFilename)
addFilenameToHeader(w, book.Title, book.LibId+"."+converter.To)
http.ServeFile(w, r, outFilename)
}
Expand Down Expand Up @@ -216,6 +217,7 @@ func (h *DownloadHandler) getFileFromArchive(book *model.Book) ([]byte, error) {
}
}

log.Printf("File `%s` not found in archive `%s` (id: %s)", bookName, archivePath, book.LibId)
return nil, os.ErrNotExist
}

Expand Down

0 comments on commit 83bdef2

Please sign in to comment.