global IS_SETUP
IS_SETUP = False

def setuplogger(filename='python.log', directory=None, format=
    'L:%(name)s M:%(module)s T:%(asctime)s > %(levelname)s: %(message)s'):
    global IS_SETUP
if directory == None:
    fd, fname = tempfile.mkstemp()
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
Обработчики журналов: как убедиться, что я не делаю два?