def setup_logging(args):
    """Setup logging handlers based on arguments
    """
    handler = logging.StreamHandler()
    handler.setFormatter(LOG_FORMAT)
    if args.debug:
        handler.setLevel(logging.DEBUG)
    elif args.quiet:
        handler.setLevel(logging.WARNING)
    else:
        handler.setLevel(logging.INFO)
    logger.addHandler(handler)

    if args.logfile:
        handler = logging.handlers.WatchedFileHandler(args.logfile)
        handler.setFormatter(LOG_FORMAT)
        if args.debug:
            handler.setLevel(logging.DEBUG)
        else:
            handler.setLevel(logging.INFO)
        logger.addHandler(handler)

    if args.eventlogfile:
        handler = logging.handlers.WatchedFileHandler(args.eventlogfile)
    else:
        handler = logging.NullHandler()
    handler.setLevel(logging.INFO)
    event_logger.addHandler(handler)
    event_logger.setLevel(logging.INFO)

    if args.trafficfile:
        handler = logging.handlers.WatchedFileHandler(args.trafficfile)
    else:
        handler = logging.NullHandler()
    handler.setLevel(logging.INFO)
    traffic_logger.addHandler(handler)
    traffic_logger.setLevel(logging.INFO)

    logger.setLevel(logging.DEBUG)
Setup logging handlers based on arguments
    
nogotofail/mitm/__main__.py