I am trying to add logging in the logging in the libreoffice calc addin. But I dont see the files being created. Am I doing anything wrong?
class NepalDataScrapperImpl(unohelper.Base, XNepalDataScrapper):
def __init__(self, ctx):
self.ctx = ctx
self.nepse = NEPSE();
self.logger=logging.getLogger('nepalDataScrapper')
hdlr = logging.FileHandler("/var/tmp/log.log")
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
self.logger.addHandler(hdlr)
def nepseSharePrice(self,symbol,date=""):
try:
price = self.nepse.getSharePrice(symbol,date)
return float(price[0])
except:
self.logger.warn("Unable to fetch price")
return -1.0