Clean up logging
This commit is contained in:
@@ -45,15 +45,13 @@ func (ws *WebService) getStatic(w http.ResponseWriter, r *http.Request) {
|
||||
if extension == ".html" { // html file
|
||||
t, err := template.ParseFS(webFS, "data/wrapper.tmpl", "data/"+path)
|
||||
if err != nil {
|
||||
log.Printf("when fetching: %s got: %s", path, err)
|
||||
daulog.SendLog(fmt.Sprintf("when fetching: %s got: %s", path, err), daulog.LogTypeError)
|
||||
w.Header().Add("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte("not found"))
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("req: %s", r.URL.Path)
|
||||
|
||||
var b struct {
|
||||
Body string
|
||||
Path string
|
||||
@@ -71,7 +69,7 @@ func (ws *WebService) getStatic(w http.ResponseWriter, r *http.Request) {
|
||||
otherStatic, err := webFS.ReadFile("data/" + path)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("when fetching: %s got: %s", path, err)
|
||||
daulog.SendLog(fmt.Sprintf("when fetching: %s got: %s", path, err), daulog.LogTypeError)
|
||||
w.Header().Add("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte("not found"))
|
||||
|
||||
Reference in New Issue
Block a user