diff pkg/wfs/download.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
line wrap: on
line diff
--- a/pkg/wfs/download.go	Sat Aug 21 15:01:52 2021 +0200
+++ b/pkg/wfs/download.go	Mon Sep 20 17:45:39 2021 +0200
@@ -20,13 +20,14 @@
 	"errors"
 	"fmt"
 	"io"
-	"log"
 	"net/http"
 	"net/url"
 	"strconv"
 	"strings"
 
 	"golang.org/x/net/html/charset"
+
+	"gemma.intevation.de/gemma/pkg/log"
 )
 
 var (
@@ -155,7 +156,7 @@
 	var numFeatures int
 
 	if supportsPaging {
-		log.Printf("info: Paging supported with %d feature per page.\n",
+		log.Infof("Paging supported with %d feature per page.\n",
 			featuresPerPage)
 
 		if !op.SupportsHits() {
@@ -163,12 +164,12 @@
 		} else {
 			numFeatures, err = numberFeaturesGET(getU, featureTypeName, wfsVersion)
 			if err != nil {
-				log.Printf("error: %v\n", err)
+				log.Errorf("%v\n", err)
 				supportsPaging = false
 			} else if numFeatures == 0 {
 				return nil, nil
 			} else {
-				log.Printf("info: Number of features: %d\n", numFeatures)
+				log.Infof("Number of features: %d\n", numFeatures)
 			}
 		}
 	}
@@ -224,10 +225,10 @@
 		}
 		if numFeatures > 0 {
 			if numFeatures <= featuresPerPage {
-				log.Println("info: All features can be fetched in one page.")
+				log.Infof("all features can be fetched in one page.")
 				downloadURLs = []string{pagedURL(0, numFeatures)}
 			} else {
-				log.Println("info: Features need to be downloaded in pages.")
+				log.Infof("features need to be downloaded in pages.")
 				for pos := 0; pos < numFeatures; {
 					var count int
 					if rest := numFeatures - pos; rest >= numFeatures {