mirror of https://github.com/perkeep/perkeep.git
geocode: move logging
Change-Id: I42d901510f9d8085c29792fd6b7ea8e1dc082c06
This commit is contained in:
parent
f053007954
commit
f8d9e6663d
|
@ -20,6 +20,7 @@ package geocode
|
|||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sync"
|
||||
|
@ -64,6 +65,7 @@ func Lookup(ctx *context.Context, address string) ([]Rect, error) {
|
|||
}
|
||||
defer res.Body.Close()
|
||||
rects, err := decodeGoogleResponse(res.Body)
|
||||
log.Printf("Google geocode lookup (%q) = %#v, %v", address, rects, err)
|
||||
if err == nil {
|
||||
mu.Lock()
|
||||
cache[address] = rects
|
||||
|
|
|
@ -186,7 +186,6 @@ func parseExpression(ctx *context.Context, exp string) (*SearchQuery, error) {
|
|||
if strings.HasPrefix(word, "loc:") {
|
||||
where := strings.TrimPrefix(word, "loc:")
|
||||
rects, err := geocode.Lookup(ctx, where)
|
||||
log.Printf("Geocode lookup for %q: %#v", where, rects)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue