comparison pkg/controllers/geostyling.go @ 5490:5f47eeea988d logging

Use own logging package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 20 Sep 2021 17:45:39 +0200
parents 4a9a1e323e11
children
comparison
equal deleted inserted replaced
5488:a726a92ea5c9 5490:5f47eeea988d
15 15
16 import ( 16 import (
17 "bytes" 17 "bytes"
18 "fmt" 18 "fmt"
19 "io" 19 "io"
20 "log"
21 "net/http" 20 "net/http"
22 21
23 "github.com/gorilla/mux" 22 "github.com/gorilla/mux"
24 23
25 "gemma.intevation.de/gemma/pkg/geoserver" 24 "gemma.intevation.de/gemma/pkg/geoserver"
25 "gemma.intevation.de/gemma/pkg/log"
26 "gemma.intevation.de/gemma/pkg/models" 26 "gemma.intevation.de/gemma/pkg/models"
27 ) 27 )
28 28
29 const ( 29 const (
30 maxStyleSize = 5 * 1024 * 1024 30 maxStyleSize = 5 * 1024 * 1024
66 return 66 return
67 } 67 }
68 68
69 style, err := extractStyle(req) 69 style, err := extractStyle(req)
70 if err != nil { 70 if err != nil {
71 log.Printf("error: %v\n", err) 71 log.Errorf("%v\n", err)
72 http.Error(rw, "error: "+err.Error(), http.StatusBadRequest) 72 http.Error(rw, "error: "+err.Error(), http.StatusBadRequest)
73 return 73 return
74 } 74 }
75 75
76 log.Printf("info: uploaded file length: %d\n", len(style)) 76 log.Infof("uploaded file length: %d\n", len(style))
77 77
78 if err := models.UpdateInternalStyle(req, feature, style); err != nil { 78 if err := models.UpdateInternalStyle(req, feature, style); err != nil {
79 log.Printf("error: %v\n", err) 79 log.Errorf("%v\n", err)
80 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError) 80 http.Error(rw, "error: "+err.Error(), http.StatusInternalServerError)
81 return 81 return
82 } 82 }
83 83
84 geoserver.ReconfigureStyle(feature) 84 geoserver.ReconfigureStyle(feature)