i have a method
def set_logger():
handler = logging.FileHandler(logpath)
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
in the log file it is getting logged as many times i called the method . is there a way such that i can call the method once and next time just get the logger object without executing all statements
def set_logger():
handler = logging.FileHandler(logpath)
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
in the log file it is getting logged as many times i called the method . is there a way such that i can call the method once and next time just get the logger object without executing all statements