@rakeshr - I am facing the same issue. Your below suggestion works when I am running the same module but when I am import the module in another module I still get DEBUG logs from matplotlib. I tried searching on google but none of the answers worked for me. Can you please please help me here.
Thanks @SRIJAN . I am using KiteConnect python library.
My guess is KiteConnect might not be using matplotlib directly but one of the dependencies must be using.
I tried your suggestion (below code) in the script where I am importing my custom module but it is still showing me DEBUG logs. import logging logging.getLogger('matplotlib').propagate=False
To elaborate what I am doing : I have py1 something like below from kiteconnect import KiteConnect import pandas as pd import yaml
logging.basicConfig(level=logging.DEBUG)
class Zerodha: def __init__(self): # my code here
deffunction1(self): # my code here
I am importing class Zerodha in py2 from py1 import Zerodha
When I run py2 I get Matplotlib DEBUG logs where as when py1 is run I dont get logs.
There are solutions available on stackoverflow to suppress the DEBUG logs coming from Matplotlib but they doesnt work for me.
logging.basicConfig(level=logging.DEBUG)
, to disable this.logging
module in your code?logging.basicConfig(level=logging.DEBUG)
I have a feeling you are not using the KiteConnect APIs , actually you have come on this forum from the google search.
If so,then we only deal with technical queries related to KiteConnect APIs on this forum,not other programming related stuff.
Still,for this time,I will try to help you.
I don't exactly get your query.
But,this should help:
import logging
logging.getLogger('matplotlib').propagate=False
My guess is KiteConnect might not be using matplotlib directly but one of the dependencies must be using.
I tried your suggestion (below code) in the script where I am importing my custom module but it is still showing me DEBUG logs.
import logging
logging.getLogger('matplotlib').propagate=False
To elaborate what I am doing :
I have py1 something like below
from kiteconnect import KiteConnect
import pandas as pd
import yaml
logging.basicConfig(level=logging.DEBUG)
class Zerodha:
def __init__(self):
# my code here
deffunction1(self):
# my code here
I am importing class Zerodha in py2
from py1 import Zerodha
When I run py2 I get Matplotlib DEBUG logs where as when py1 is run I dont get logs.
There are solutions available on stackoverflow to suppress the DEBUG logs coming from Matplotlib but they doesnt work for me.
Any help is appreciated.
You can view all the dependencies here:
https://github.com/zerodha/pykiteconnect/blob/8e36dde9fe34bb0c7c5677a4dc0fb0b1beb40787/setup.py#L44
This is only possible when you are importing matlplotlib in py2.
Not sure why it doesn't work for you,but the solution I gave earlier works for me.
And because you are not using if __name__ == "__main__",the logging part is being imported too with the 'Zerodha' class.
Try to put logging part under if __name__ == "__main__" in py1.
Actually you can just remove the logging part if you don't want logs ,as Rakesh Sir told above,to stop these logs.
Still,if the problem isn't resolved,write on relevant forums.
We can't help anymore as we don't provide programming support on this forum.
This forum is purely dedicated to technical queries related to KiteConnect APIs.