Skip to content

Commit 816c4f3

Browse files
committed
unified logging
1 parent b12d740 commit 816c4f3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

qiita_client/qiita_client.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,10 @@ def fetch_file_from_central(self, filepath, prefix=None):
774774
str : the filepath of the requested file within the local file system
775775
"""
776776
target_filepath = filepath
777+
logger.debug(
778+
'Fetching file "%s" via protocol=%s from Qiita main.' % (
779+
filepath, self._plugincoupling))
780+
777781
if (prefix is not None) and (prefix != ""):
778782
# strip off root
779783
if filepath.startswith(os.path.abspath(os.sep)):
@@ -790,19 +794,13 @@ def fetch_file_from_central(self, filepath, prefix=None):
790794

791795
shutil.copyfile(filepath, target_filepath)
792796

793-
logger.debug(
794-
'Fetching file "%s" via protocol=%s from Qiita main.' % (
795-
filepath, self._plugincoupling))
796-
797797
return target_filepath
798798

799799
elif self._plugincoupling == 'https':
800800
# strip off root
801801
if filepath.startswith(os.path.abspath(os.sep)):
802802
filepath = filepath[len(os.path.abspath(os.sep)):]
803803

804-
logger.debug('Requesting file %s from qiita server.' % filepath)
805-
806804
# actual call to Qiita central to obtain file content
807805
content = self.get(
808806
'/cloud/fetch_file_from_central/' + filepath,
@@ -816,10 +814,6 @@ def fetch_file_from_central(self, filepath, prefix=None):
816814
with open(target_filepath, 'wb') as f:
817815
f.write(content)
818816

819-
logger.debug(
820-
'Fetching file "%s" via protocol=%s from Qiita main.' % (
821-
filepath, self._plugincoupling))
822-
823817
return target_filepath
824818

825819
else:

0 commit comments

Comments
 (0)