def accepted_log_levels(logical_line, filename):
    """In Sahara we use only 5 log levels.

    This check is needed because we don't want new contributors to
    use deprecated log levels.
    S373
    """

    # NOTE(Kezar): sahara/tests included because we don't require translations
    # in tests. sahara/openstack/common included because it's part imported
    # from oslo and we don't change it forever and ever. sahara/db/templates
    # provide separate cli interface so we don't want to translate it.

    ignore_dirs = ["sahara/db/templates",
                   "sahara/tests",
                   "sahara/openstack/common"]
    for directory in ignore_dirs:
        if directory in filename:
            return
    msg = ("S373 You used deprecated log level. Accepted log levels are "
           "debug|info|warning|error|critical")
    if logical_line.startswith("LOG."):
        if not accepted_log_level.search(logical_line):
            yield(0, msg)
dataset/ETHPy150Open openstack/sahara/sahara/utils/hacking/logging_checks.py/accepted_log_levels/original