Twisted and KiteTickerClientFactory logs

vijoeyz
Recently, I made changes to run kite connect in a different process as follows:
p = subprocess.Popen(cmd, stdin = sub.DEVNULL, stdout = f, \
stderr = f, cwd = os.getcwd(), startupinfo = si)
And since then, Kite Connect library logs are showing up in my logs! (examples below) This is probably due to stdoutand stderrassignments above, but removing them has not helped. How do I disable such logs from appearing in my logs?
2024-01-29 09:09:50+0530 [-] Starting factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x000001525D8CEEF0>
2024-01-29 11:50:51+0530 [-] dropping connection to peer tcp4:15.206.6.240:443 with abort=True: None
2024-01-29 11:50:51+0530 [-] dropping connection to peer tcp4:43.205.183.135:443 with abort=True: None
2024-01-29 11:50:51+0530 [-] <twisted.internet.tcp.Connector instance at 0x1525d853760 disconnected IPv4Address(type='TCP', host='ws.kite.trade', port=443)> will retry in 2 seconds
2024-01-29 11:50:51+0530 [-] Stopping factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x000001525D8527A0>
2024-01-29 11:50:51+0530 [-] <twisted.internet.tcp.Connector instance at 0x1525d8cee90 disconnected IPv4Address(type='TCP', host='ws.kite.trade', port=443)> will retry in 2 seconds
  • rakeshr
    Have you enabled the debug flag in the KiteConnect initialization?
    Also, make sure you have not enabled event logging at the program level.
  • vijoeyz
    You're right. debug arg is true in KiteConnect(). However, after I set stdout = sub.DEVNULL in the above code snippet, twisted logs disappeared.

    I did not understand "event logging at the program level". How to set or unset this?
  • rakeshr
    event logging at the program level
    logging.basicConfig(level=logging.DEBUG) , using the logging package.
This discussion has been closed.