Skip to content

Commit

Permalink
[downloader:common] enable 'job'/'extractor' for logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 12, 2020
1 parent e89413d commit 200aea3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gallery_dl/downloader/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2014-2019 Mike Fährmann
# Copyright 2014-2020 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
Expand All @@ -20,10 +20,13 @@ class DownloaderBase():
def __init__(self, extractor, output):
self.session = extractor.session
self.out = output
self.log = logging.getLogger("downloader." + self.scheme)
self.part = self.config("part", True)
self.partdir = self.config("part-directory")

self.log = logging.getLogger("downloader." + self.scheme)
self.log.job = extractor.log.job
self.log.extractor = extractor

if self.partdir:
self.partdir = util.expand_path(self.partdir)
os.makedirs(self.partdir, exist_ok=True)
Expand Down

0 comments on commit 200aea3

Please sign in to comment.