From bf5f6b98a1d933d5f0ffb7fe965428f4dab5e3b0 Mon Sep 17 00:00:00 2001 From: horus Date: Fri, 16 Feb 2018 18:06:50 +0100 Subject: Structured logging part two. (crawler) --- crawler/utility.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'crawler/utility.go') 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") } -- cgit v1.2.3