def configure_logging(level, format, filename):

    logging.root.handlers = []

    handler = logging.StreamHandler()
    if filename:
        handler = logging.handlers.WatchedFileHandler(filename)

    handler.setFormatter(logging.Formatter(format))

    logging.root.addHandler(handler)

    if level is not None:
        logging.root.setLevel(level)

    return handler.stream.fileno()
Like ``logging.basicConfig`` but we use WatchedFileHandler so that we play
dataset/ETHPy150Open thread/django-lightweight-queue/django_lightweight_queue/utils.py/configure_logging