diff --git a/hepcrawl/pipelines.py b/hepcrawl/pipelines.py index dfc3f1f..1be5ad2 100644 --- a/hepcrawl/pipelines.py +++ b/hepcrawl/pipelines.py @@ -101,7 +101,7 @@ def process_item(self, item, spider): if 'dois' in item: value = [doi['value'] for doi in item['dois']] if len(value) > 0: - self.logger.info('Processing article.', name=spider.name, doi=value[0]) + self.logger.info('Processing article.', name=spider.name, doi=str(value[0])) self.dois.append(value) else: self.logger.error('Empty DOIs for this article.', name=spider.name) @@ -273,5 +273,7 @@ def close_spider(self, spider): task_endpoint, kwargs=self._prepare_payload(spider), ) - + self.logger.info('Spider successfully send payload.', name=spider.name, dois=self.dois, count=self.count) + else: + self.logger.error('Spider cannot send payload.', name=spider.name, dois=self.dois, count=self.count) self._cleanup(spider)