Mercurial > gemma
comparison pkg/wfs/global.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 | 16259efa828f |
children | 09346efa7f69 |
comparison
equal
deleted
inserted
replaced
5488:a726a92ea5c9 | 5490:5f47eeea988d |
---|---|
16 import ( | 16 import ( |
17 "bufio" | 17 "bufio" |
18 "fmt" | 18 "fmt" |
19 "io" | 19 "io" |
20 "io/ioutil" | 20 "io/ioutil" |
21 "log" | |
22 "os" | 21 "os" |
23 "os/exec" | 22 "os/exec" |
24 "path/filepath" | 23 "path/filepath" |
25 | 24 |
26 "gemma.intevation.de/gemma/pkg/config" | 25 "gemma.intevation.de/gemma/pkg/config" |
26 "gemma.intevation.de/gemma/pkg/log" | |
27 ) | 27 ) |
28 | 28 |
29 var ( | 29 var ( |
30 // FormatGeoJSON is a list of MIME types of | 30 // FormatGeoJSON is a list of MIME types of |
31 // GeoJSON documents. | 31 // GeoJSON documents. |
57 var GetFeatures = setup() | 57 var GetFeatures = setup() |
58 | 58 |
59 func setup() func(*Capabilities, string, string) (Downloader, error) { | 59 func setup() func(*Capabilities, string, string) (Downloader, error) { |
60 path, err := exec.LookPath("ogr2ogr") | 60 path, err := exec.LookPath("ogr2ogr") |
61 if err != nil { | 61 if err != nil { |
62 log.Println("info: ogr2ogr not installed. Using direct GeoJSON WFS download.") | 62 log.Infoln("ogr2ogr not installed. Using direct GeoJSON WFS download.") |
63 return getFeaturesGeoJSON | 63 return getFeaturesGeoJSON |
64 } | 64 } |
65 log.Printf("info: ogr2ogr found at %s. Using GML WFS download.\n", path) | 65 log.Infof("ogr2ogr found at %s. Using GML WFS download.\n", path) |
66 return getFeaturesGML | 66 return getFeaturesGML |
67 } | 67 } |
68 | 68 |
69 func getFeaturesGeoJSON( | 69 func getFeaturesGeoJSON( |
70 caps *Capabilities, | 70 caps *Capabilities, |