I am using the ssh client provided by Paramiko to create a function call remoteSSH
(the file name is remoteConnect.py
):
import paramiko
import logging
logger = paramiko.util.logging.getLogger()
logger.setLevel(logging.WARN)
def remoteSSH(username,userpasswd):
....
Now I am calling the remoteSSH
function in another Python module called getData()
(getdata.py
):
from remoteConnect import *
import logging
logger2=logging.getLogger()
logger2.setLevel(logging.INFO)
However, a call to logger2.info('ccc')
also turns on all INFO level logging in the file that is importing the Paramiko module (i.e. remoteConnect.py
)
How do I turn off logging in remoteConnect.py
so that Paramiko does not spit out all the INFO level messages?