From a2d595423e4270d8e644212021ba70c70df075d9 Mon Sep 17 00:00:00 2001 From: Maximilian Möhring Date: Tue, 14 May 2019 17:35:18 +0200 Subject: Refactores logging functions. (crawler) --- crawler/shop_whiskyde.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crawler/shop_whiskyde.go') diff --git a/crawler/shop_whiskyde.go b/crawler/shop_whiskyde.go index d3087ca..d06f522 100644 --- a/crawler/shop_whiskyde.go +++ b/crawler/shop_whiskyde.go @@ -37,7 +37,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { if err != nil { W.error_msg = err.Error() W.error_ctx = e.ChildText("del") - PrintlnOffer(W, "Whisky.de: Converting original price failed") + W.Println("Whisky.de: Converting original price failed") return } }) @@ -46,7 +46,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { if err != nil { W.error_msg = err.Error() W.error_ctx = e.ChildText(".article-price-default") - PrintlnOffer(W, "Whisky.de: Converting discounted price failed") + W.Println("Whisky.de: Converting discounted price failed") return } }) @@ -64,7 +64,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { if !strings.Contains(text_noisy, "Liter") { W.error_ctx = text_noisy W.error_msg = "Whisky.de: String 'Liter' not found." - PrintlnOffer(W, "Whisky.de: String 'Liter' not found.") + W.Println("Whisky.de: String 'Liter' not found.") return } @@ -73,27 +73,27 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { if err != nil { W.error_msg = err.Error() W.error_ctx = text_noisy - PrintlnOffer(W, "Whisky.de: Extracting volume failed") + W.Println("Whisky.de: Extracting volume failed") return } W.Abv, err = extract_abv(abv_noisy) if err != nil { W.error_msg = err.Error() W.error_ctx = abv_noisy - PrintlnOffer(W, "Whisky.de: Extracting abv failed") + W.Println("Whisky.de: Extracting abv failed") return } if W.Volume == 0 { W.error_msg = "Whisky.de: Volume is zero" W.error_ctx = text_noisy - PrintlnOffer(W, "Whisky.de: Volume is zero") + W.Println("Whisky.de: Volume is zero") return } if W.Abv == 0 { W.error_msg = "Whisky.de: Abv is zero" W.error_ctx = abv_noisy - PrintlnOffer(W, "Whisky.de: Abv is zero") + W.Println("Whisky.de: Abv is zero") return } @@ -101,7 +101,7 @@ func (app *App) ScrapeWhiskyde(shop Shop) []Angebot { if err != nil { W.error_msg = err.Error() W.error_ctx = e.ChildText(".article-unitprice-default") - PrintlnOffer(W, "Whisky.de: Converting base price failed") + W.Println("Whisky.de: Converting base price failed") return } -- cgit v1.2.3