From de8d71c6ca1699008289429e86c18f9f223eb0ef Mon Sep 17 00:00:00 2001 From: Guilherme Silveira Date: Sun, 4 Aug 2024 16:39:12 -0300 Subject: [PATCH] log advfn error --- src/crawler_advfn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crawler_advfn.py b/src/crawler_advfn.py index 42bfde7..348cf2c 100644 --- a/src/crawler_advfn.py +++ b/src/crawler_advfn.py @@ -1,4 +1,5 @@ import sys +import logging from bs4 import BeautifulSoup import pandas as pd @@ -11,6 +12,7 @@ from src.utils import CACHE_DIR +logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(levelname)s:%(message)s') this = sys.modules[__name__] @@ -26,7 +28,8 @@ def busca_parametros(ticker): this.advfn = CrawlerAdvfn() return this.advfn.recupera_informacoes(ticker) - except Exception: + except Exception as ex: + logging.error("Error in busca_parametros: %s", ex, exc_info=True) return None