@skip_ignored_lines
def check_import_of_logging(logical_line, physical_line, filename):

    excluded_files = ["./rally/common/logging.py",
                      "./tests/unit/test_logging.py",
                      "./tests/ci/rally_verify.py"]

    forbidden_imports = ["from oslo_log",
                         "import oslo_log",
                         "import logging"]

    if filename not in excluded_files:
        for forbidden_import in forbidden_imports:
            if logical_line.startswith(forbidden_import):
                yield (0, "N310 Wrong module for logging is imported. Please "
                          "use `rally.common.logging` instead.")
Check correctness import of logging module
dataset/ETHPy150Open openstack/rally/tests/hacking/checks.py/check_import_of_logging