def loglevel_option(args, run):
    """
    Set the LogLevel.

    Loglevel either as 0 - 50 or as string: DEBUG(10),
    INFO(20), WARNING(30), ERROR(40), CRITICAL(50)
    """
    # TODO: sacred.initialize.create_run already takes care of this

    try:
        lvl = int(args)
    except ValueError:
        lvl = args
    run.root_logger.setLevel(lvl)

    Set the LogLevel.

    Loglevel either as 0 - 50 or as string: DEBUG(10),
    INFO(20), WARNING(30), ERROR(40), CRITICAL(50)
    
sacred/commandline_options.py