Skip to content

Commit

Permalink
move logging to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sbusso committed May 8, 2024
1 parent b8e6527 commit c0b6cac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "scrapework"
version = "0.5.1"
version = "0.5.3"
description = "simple scraping framework"
authors = ["Stéphane Busso <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion scrapework/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
class Module(ABC):
def __init__(self) -> None:
self.logger = Logger().get_logger()
self.logger.info(f"Using {self.__class__.__name__}")
self.logger.debug(f"Using {self.__class__.__name__}")
2 changes: 1 addition & 1 deletion scrapework/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Processor(ABC):

def __init__(self) -> None:
self.logger = Logger().get_logger()
self.logger.info(f"Using processor: {self.__class__.__name__}")
self.logger.debug(f"Using processor: {self.__class__.__name__}")

@abstractmethod
def process_items(
Expand Down
11 changes: 6 additions & 5 deletions scrapework/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ def run(self, start_urls: Optional[List[str]] = None, input: Optional[Any] = Non

# TODO: self.process(ctx, new_items)

# append new_items to items, Items can be a list or a dict
if isinstance(new_items, dict):
items.append(new_items)
else:
items += new_items
# append new_items to items, Items can be a list or a dict or None
if new_items:
if isinstance(new_items, dict):
items.append(new_items)
else:
items += new_items

iter_end_time = datetime.datetime.now()
items_count = len(items)
Expand Down

0 comments on commit c0b6cac

Please sign in to comment.