소스 검색

Adjust logging levels: log individual request failures only at WARNING and cancelled tasks at ERROR level

tags/v0.2.2
JustAnotherArchivist 4 년 전
부모
커밋
dd44d9b174
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -2
      qwarc/__init__.py

+ 2
- 2
qwarc/__init__.py 파일 보기

@@ -86,7 +86,7 @@ class Item:
self.stats['rx'] += rx
self.stats['requests'] += 1
except (asyncio.TimeoutError, _aiohttp.ClientError) as e:
self.logger.error(f'Request for {url} failed: {e!r}')
self.logger.warning(f'Request for {url} failed: {e!r}')
action, writeToWarc = await responseHandler(url, attempt, response, e)
exc = e # Pass the exception outward for the history
else:
@@ -225,7 +225,7 @@ class QWARC:
except concurrent.futures.CancelledError as e:
# Got cancelled, nothing we can do about it, but let's log a warning if it's a process task
if future.taskType == 'process':
logging.warning(f'Task for {future.itemType}:{future.itemValue} cancelled: {future!r}')
logging.error(f'Task for {future.itemType}:{future.itemValue} cancelled: {future!r}')
newStatus = STATUS_ERROR
except Exception as e:
if future.taskType == 'process':


불러오는 중...
취소
저장