directory = os.path.dirname(fname)
logging.basicConfig(filename=directory + '/' + filename, format=format)
IS_SETUP = True

def getlog(logname, level=logging.INFO):
    """returns a logger with logname that will print to filename and directoryname."""
if IS_SETUP == False:
    setuplogger()
mylog = logging.getLogger(logname)
mylog.setLevel(level)
mylog.info('NEW LOGGER STARTED')
return mylog
Logging Handlers: How do I make sure I am not making two?