summaryrefslogtreecommitdiff
path: root/jfr_playoff/remote.py
diff options
context:
space:
mode:
authorMichaƂ Klichowicz <emkael@tlen.pl>2018-10-17 20:02:57 +0200
committerGitHub <noreply@github.com>2018-10-17 20:02:57 +0200
commit984540cd2dfba29c1dc9cbc43ab6fa4c85c7727b (patch)
treed03e49f564cec7c3eec7ce7c98fae530ec1544e0 /jfr_playoff/remote.py
parent9a5f06ee9cddd38e11f49a2f934de202d34e63e2 (diff)
parent31fc51ce22e7c5197ed367cadd14d8a258f8fd65 (diff)
Merge pull request #28 from emkael/develv1.2.0
v1.2
Diffstat (limited to 'jfr_playoff/remote.py')
-rw-r--r--jfr_playoff/remote.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/jfr_playoff/remote.py b/jfr_playoff/remote.py
index b687740..f0bf6c2 100644
--- a/jfr_playoff/remote.py
+++ b/jfr_playoff/remote.py
@@ -3,6 +3,7 @@ import re
import requests
from bs4 import BeautifulSoup as bs
+from jfr_playoff.logger import PlayoffLogger
class RemoteUrl:
@@ -10,6 +11,8 @@ class RemoteUrl:
@classmethod
def fetch(cls, url):
+ PlayoffLogger.get('remote').info(
+ 'fetching content for: %s', url)
if url not in cls.url_cache:
request = requests.get(url)
encoding_match = re.search(
@@ -18,4 +21,7 @@ class RemoteUrl:
if encoding_match:
request.encoding = encoding_match.group(2)
cls.url_cache[url] = request.text
+ PlayoffLogger.get('remote').info(
+ 'fetched %d bytes from remote location',
+ len(cls.url_cache[url]))
return bs(cls.url_cache[url], 'lxml')