I am using session.request
call multiple time at multiple places. I want to block its log for a specific call. How can I achieve that. I figured that we can block it for all the requests call using following method
logging.basicConfig(filename=filename,
format='%(asctime)s %(funcName)s %(levelname)s %(message)s',
filemode='a')
logger = logging.getLogger("requests").setLevel(logging.WARNING) # To disable requests logging info
def fun1():
session.request('POST', _endpoint, json=data)
def fun2():
session.request('POST', _endpoint, json=data)
I want to disable logs for fun1
but keep it running for fun2
. Is it possible to customize logs in such a way that I can disable them for a particular function of call?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…