Skip to content

Commit

Permalink
UPDATE: Exception log
Browse files Browse the repository at this point in the history
  • Loading branch information
leegeunhyeok committed Feb 5, 2020
1 parent 2627650 commit ab54afd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ def download(self, image_list, count, lock, parser_running):
break
except Exception as e:
time.sleep(3)
self._logger.error(str(e) + ' - Attempt({}/{})' \
.format(attempt, Downloader.__ATTEMPT__))
self._logger.error(
'{}:{} - Attempt({}/{})'.format(
image_data['src'],
str(e),
attempt,
Downloader.__ATTEMPT__
)
)

self._logger.info(name, '종료')
7 changes: 5 additions & 2 deletions src/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ def parse(self, content_list, image_list, feeder_running, parser_running):
break
except Exception as e:
time.sleep(3)
self._logger.error(str(e) + ' - Attempt({}/{})' \
.format(attempt, Parser.__ATTEMPT__))
self._logger.error(
'{}:{} - Attempt({}/{})'.format(
target_url, str(e), attempt, Parser.__ATTEMPT__
)
)

parser_running.value = 0
parser_driver.close()
Expand Down

0 comments on commit ab54afd

Please sign in to comment.