I'm using Pysftp to sftp put a large number of files, and would love to get some progress outputs as it runs so I know how it's doing. Is there a verbose option (or equivalent) I can use to get that ouput?
Thanks.
I'm using Pysftp to sftp put a large number of files, and would love to get some progress outputs as it runs so I know how it's doing. Is there a verbose option (or equivalent) I can use to get that ouput?
Thanks.
I could be incorrectly importing paramiko here as I believe its in pysftp anyway but you should get the jist.
import logging
import paramiko
import pysftp
paramiko.util.log_to_file('log_debug.txt', level = 'DEBUG')
# As far as I can see you can use DEBUG, INFO, WARNING or ERROR here but there's possibly more
with pysftp.Connection([whatever you're doing here normally]) as sftp:
sftp.put([or whatever you're doing here instead])
with open('log_debug.txt') as logfile:
log = logfile.read()
print (log)
Obviously you don't have to print it, do what you like...
I've only got this from trying to do something similar, I'm not an expert!