summaryrefslogtreecommitdiff
path: root/crawler/utility.go
diff options
context:
space:
mode:
authorhorus2018-02-16 18:06:50 +0100
committerhorus2018-02-16 18:06:50 +0100
commitbf5f6b98a1d933d5f0ffb7fe965428f4dab5e3b0 (patch)
treec95eb6426b61965b37da2b60da36cfe2c02a92b4 /crawler/utility.go
parented6ab4da59f80bf9fa2cbf15da5c9167dff44ea4 (diff)
downloadalkobote-bf5f6b98a1d933d5f0ffb7fe965428f4dab5e3b0.tar.gz
Structured logging part two. (crawler)
Diffstat (limited to 'crawler/utility.go')
-rw-r--r--crawler/utility.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/crawler/utility.go b/crawler/utility.go
index 98587c9..3c587b9 100644
--- a/crawler/utility.go
+++ b/crawler/utility.go
@@ -138,17 +138,15 @@ func get_volume(e *colly.HTMLElement) float32 {
matched, err := regexp.MatchString(`[lL](iter)?`, volume_noisy)
if err != nil {
Fatal(err, "Get volume regex failed")
- log.Fatal(err)
}
if !matched {
- log.Println("get_volume: not matched: " + volume_noisy)
+ log.Debug("get_volume: not matched: " + volume_noisy)
return 0
}
volume, err := extract_volume(volume_noisy)
if err != nil {
- log.Println("get_volume: " + volume_noisy)
- Fatal(err, "Get Volume: Extract Volume failed")
+ Fatal(err, "Get Volume: Extract Volume failed: "+volume_noisy)
}
return volume
@@ -168,8 +166,7 @@ func get_abv(e *colly.HTMLElement) float32 {
abv, err := extract_abv(abv_noisy)
if err != nil {
- log.Println("get_abv: " + abv_noisy)
- Fatal(err, "Get ABV: Extract ABV failed")
+ Fatal(err, "Get ABV: Extract ABV failed: "+abv_noisy)
}
return abv
@@ -188,7 +185,6 @@ func get_base_price(e *colly.HTMLElement) int {
base_price, err := sanitize_base_price(base_price_noisy)
if err != nil {
- log.Println("get_base_price: " + base_price_noisy)
Fatal(err, "Get base price: sanitize base price failed")
}