Skip to content

Commit ec6cf58

Browse files
committed
Enhancing logging messages to be more specific.
1 parent 28179e8 commit ec6cf58

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

application/features/SFTP.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ def connect(self, *args, **kwargs):
6161
def ls(self, path=""):
6262
try:
6363
if path != "":
64+
logger.debug("SFTP: Execute ls on path %s", path)
6465
self.sftp.chdir(path)
66+
else:
67+
logger.debug("SFTP: Execute ls on the current working directory")
6568
cwd = self.sftp.getcwd()
6669
attrs = self.sftp.listdir_attr(cwd)
67-
logger.debug("SFTP: ls %s: %s", cwd, attrs)
6870

6971
file_list = []
7072
# TODO: should support uid and gid later
@@ -77,6 +79,7 @@ def ls(self, path=""):
7779
"mtime": file_attr.st_mtime
7880
}
7981
file_list.append(file)
82+
logger.debug("SFTP: ls completed successfully")
8083
except Exception as e:
8184
logger.exception("SFTP: ls failed")
8285
return False, repr(e), []
@@ -171,7 +174,7 @@ def rm(self, cwd, file_list):
171174

172175
counter += 1
173176
if counter == 50:
174-
logger.debug("SFTP: Execute Command %s", ' '.join(cmd_list))
177+
logger.debug("SFTP: Execute Command %s with file counter of 50", ' '.join(cmd_list))
175178
_, _, stderr = self.client.exec_command(" ".join(cmd_list))
176179
stderr_lines = stderr.readlines()
177180
if len(stderr_lines) != 0:

0 commit comments

Comments
 (0)