diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-12-15 18:55:57 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-12-15 18:55:57 -0800 |
commit | 1d8193b892bf63db6b91c66b9d048873bf1bc4cf (patch) | |
tree | 4ca54691f7fab88f73f657f005e26d75ae5f0058 /reader/readability | |
parent | c6d9eb361454b70406cf6573b284d5e99ba3a2d2 (diff) |
Add logger
Diffstat (limited to 'reader/readability')
-rw-r--r-- | reader/readability/readability.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/reader/readability/readability.go b/reader/readability/readability.go index 37b4813..5eb4cc3 100644 --- a/reader/readability/readability.go +++ b/reader/readability/readability.go @@ -8,12 +8,12 @@ import ( "bytes" "fmt" "io" - "log" "math" "regexp" "strings" "github.com/PuerkitoBio/goquery" + "github.com/miniflux/miniflux/logger" "golang.org/x/net/html" ) @@ -83,10 +83,10 @@ func ExtractContent(page io.Reader) (string, error) { removeUnlikelyCandidates(document) candidates := getCandidates(document) - log.Println("Candidates:", candidates) + logger.Debug("[Readability] Candidates: %v", candidates) topCandidate := getTopCandidate(document, candidates) - log.Println("TopCandidate:", topCandidate) + logger.Debug("[Readability] TopCandidate: %v", topCandidate) output := getArticle(topCandidate, candidates) return output, nil @@ -142,7 +142,6 @@ func removeUnlikelyCandidates(document *goquery.Document) { str := class + id if blacklistCandidatesRegexp.MatchString(str) || (unlikelyCandidatesRegexp.MatchString(str) && !okMaybeItsACandidateRegexp.MatchString(str)) { - // log.Printf("Removing unlikely candidate - %s\n", str) removeNodes(s) } }) |