<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main():
 """Run server."""


    global DEFAULT_SERVER_PORT, DEFAULT_SERVER_LISTEN_ADDRESS, DEFAULT_LOGGING_LEVEL

    # Check for environment variables
    if 'ANYBADGE_PORT' in environ:
        DEFAULT_SERVER_PORT = environ['ANYBADGE_PORT']

    if 'ANYBADGE_LISTEN_ADDRESS' in environ:
        DEFAULT_SERVER_LISTEN_ADDRESS = environ['ANYBADGE_LISTEN_ADDRESS']

    if 'ANYBADGE_LOG_LEVEL' in environ:
        DEFAULT_LOGGING_LEVEL = logging.getLevelName(environ['ANYBADGE_LOG_LEVEL'])

    # Parse command line args
    args = parse_args()

    # Set logging level
    logging_level = DEFAULT_LOGGING_LEVEL
    if args.debug:
        logging_level = logging.DEBUG

    logging.basicConfig(format='%(asctime)-15s %(levelname)s:%(filename)s(%(lineno)d):%(funcName)s: %(message)s',
                        level=logging_level)
    logger.info('Starting up anybadge server.')

    run(listen_address=args.listen_address, port=args.port)