diff --git a/src/logger.py b/src/logger.py index 135f144..b37a01b 100644 --- a/src/logger.py +++ b/src/logger.py @@ -6,7 +6,7 @@ import sys APP_LOG_FILE = 'debug.log' ERROR_LOG_FILE = "error.log" -MESSAGE_FORMAT = "%(asctime)s %(name)s %(levelname)s: %(message)s" +MESSAGE_FORMAT = u"%(asctime)s %(name)s %(levelname)s: %(message)s" DATE_FORMAT = u"%d/%m/%Y %H:%M:%S" formatter = logging.Formatter(MESSAGE_FORMAT.decode("utf-8"), datefmt=DATE_FORMAT) diff --git a/src/utils.py b/src/utils.py index 6c27848..974e40d 100644 --- a/src/utils.py +++ b/src/utils.py @@ -3,7 +3,8 @@ import os import requests import re - +import logging +log = logging.getLogger("utils") url_re = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*") bad_chars = '\'\\.,[](){}:;"' @@ -56,4 +57,5 @@ def download_file(url, local_filename, window): def clean_text(text): """ Replaces all HTML entities and put the plain text equivalent if it's possible.""" text = text.replace("
", "\n") + text = text.replace("\\n", "\n") return text \ No newline at end of file