diff --git a/codebasin/config.py b/codebasin/config.py index 8a73cec..047abcd 100644 --- a/codebasin/config.py +++ b/codebasin/config.py @@ -12,7 +12,7 @@ from codebasin import CompilationDatabase, util -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) def extract_defines(argv): diff --git a/codebasin/file_parser.py b/codebasin/file_parser.py index 2b14873..a57f248 100644 --- a/codebasin/file_parser.py +++ b/codebasin/file_parser.py @@ -11,7 +11,7 @@ from codebasin import preprocessor, util from codebasin.file_source import get_file_source -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) class LineGroup: diff --git a/codebasin/file_source.py b/codebasin/file_source.py index 296b75c..42b4b76 100644 --- a/codebasin/file_source.py +++ b/codebasin/file_source.py @@ -10,7 +10,7 @@ from codebasin.language import FileLanguage -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) # This string was created by looking at all unicode code points # and checking to see if they are considered whitespace diff --git a/codebasin/finder.py b/codebasin/finder.py index 819b6f2..34fb802 100644 --- a/codebasin/finder.py +++ b/codebasin/finder.py @@ -14,7 +14,7 @@ from codebasin.language import FileLanguage from codebasin.walkers.tree_associator import TreeAssociator -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) class FileInfo: diff --git a/codebasin/preprocessor.py b/codebasin/preprocessor.py index 1b1d342..9991b86 100644 --- a/codebasin/preprocessor.py +++ b/codebasin/preprocessor.py @@ -18,7 +18,7 @@ from codebasin import util from codebasin.walkers.tree_associator import TreeAssociator -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) def toklist_print(toklist): diff --git a/codebasin/report.py b/codebasin/report.py index 0244fe1..34a480a 100644 --- a/codebasin/report.py +++ b/codebasin/report.py @@ -10,7 +10,7 @@ from codebasin import util -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) def extract_platforms(setmap): diff --git a/codebasin/util.py b/codebasin/util.py index 764cc18..5982d84 100644 --- a/codebasin/util.py +++ b/codebasin/util.py @@ -20,7 +20,7 @@ import jsonschema -log = logging.getLogger("codebasin") +log = logging.getLogger(__name__) def compute_file_hash(fname): diff --git a/tests/basic_asm/test_basic_asm.py b/tests/basic_asm/test_basic_asm.py index 952a186..a3bef31 100644 --- a/tests/basic_asm/test_basic_asm.py +++ b/tests/basic_asm/test_basic_asm.py @@ -16,7 +16,7 @@ class TestBasicAsm(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = {frozenset(["CPU"]): 24} diff --git a/tests/basic_fortran/test_basic_fortran.py b/tests/basic_fortran/test_basic_fortran.py index 2995ad6..e3a244a 100644 --- a/tests/basic_fortran/test_basic_fortran.py +++ b/tests/basic_fortran/test_basic_fortran.py @@ -16,7 +16,7 @@ class TestBasicFortran(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset(["CPU"]): 2, diff --git a/tests/build-dir/test_build_dir.py b/tests/build-dir/test_build_dir.py index dc12307..95b46ba 100644 --- a/tests/build-dir/test_build_dir.py +++ b/tests/build-dir/test_build_dir.py @@ -18,7 +18,7 @@ class TestBuildDirectories(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = False + logging.disable(logging.NOTSET) def test_absolute_paths(self): """ diff --git a/tests/code-base/test_code_base.py b/tests/code-base/test_code_base.py index 8e1db81..0438b8a 100644 --- a/tests/code-base/test_code_base.py +++ b/tests/code-base/test_code_base.py @@ -16,7 +16,7 @@ class TestCodeBase(unittest.TestCase): """ def setUp(self): - logging.getLogger("codebasin").disabled = False + logging.disable() warnings.simplefilter("ignore", ResourceWarning) # Create a temporary codebase spread across two directories diff --git a/tests/commented_directive/test_commented_directive.py b/tests/commented_directive/test_commented_directive.py index 42dcd54..0ae12b9 100644 --- a/tests/commented_directive/test_commented_directive.py +++ b/tests/commented_directive/test_commented_directive.py @@ -17,7 +17,7 @@ class TestCommentedDirective(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = {frozenset(["CPU", "GPU"]): 5} diff --git a/tests/compilers/test_compilers.py b/tests/compilers/test_compilers.py index 02f6abd..7afcd88 100644 --- a/tests/compilers/test_compilers.py +++ b/tests/compilers/test_compilers.py @@ -12,7 +12,7 @@ class TestCompilers(unittest.TestCase): """ def setUp(self): - logging.getLogger("codebasin").disabled = True + logging.disable() def test_clang(self): """compilers/clang""" diff --git a/tests/define/test_define.py b/tests/define/test_define.py index 99e2169..b27aff5 100644 --- a/tests/define/test_define.py +++ b/tests/define/test_define.py @@ -16,7 +16,7 @@ class TestDefine(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset([]): 4, diff --git a/tests/disjoint/test_disjoint.py b/tests/disjoint/test_disjoint.py index beeb83a..1ec9b8c 100644 --- a/tests/disjoint/test_disjoint.py +++ b/tests/disjoint/test_disjoint.py @@ -18,7 +18,7 @@ class TestDisjointCodebase(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = {frozenset(["CPU"]): 6, frozenset(["GPU"]): 6} diff --git a/tests/duplicates/test_duplicates.py b/tests/duplicates/test_duplicates.py index 20e7c06..459f29e 100644 --- a/tests/duplicates/test_duplicates.py +++ b/tests/duplicates/test_duplicates.py @@ -16,7 +16,7 @@ class TestDuplicates(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() def test_duplicates(self): """Check that duplicate files count towards divergence.""" diff --git a/tests/exclude/test_exclude.py b/tests/exclude/test_exclude.py index 4d51234..b640e17 100644 --- a/tests/exclude/test_exclude.py +++ b/tests/exclude/test_exclude.py @@ -16,7 +16,7 @@ class TestExclude(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() def _get_setmap(self, excludes): codebase = CodeBase( diff --git a/tests/include/test_include.py b/tests/include/test_include.py index 2b347d8..65e38ad 100644 --- a/tests/include/test_include.py +++ b/tests/include/test_include.py @@ -17,7 +17,7 @@ class TestInclude(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset(["CPU"]): 11, diff --git a/tests/literals/test_literals.py b/tests/literals/test_literals.py index 44651f2..0a8b28d 100644 --- a/tests/literals/test_literals.py +++ b/tests/literals/test_literals.py @@ -17,7 +17,7 @@ class TestLiterals(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = {frozenset(["CPU", "GPU"]): 9} diff --git a/tests/macro_expansion/test_macro_expansion.py b/tests/macro_expansion/test_macro_expansion.py index 2b61826..5ad699b 100644 --- a/tests/macro_expansion/test_macro_expansion.py +++ b/tests/macro_expansion/test_macro_expansion.py @@ -16,7 +16,7 @@ class TestMacroExpansion(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset([]): 14, diff --git a/tests/multi_line/test_multi_line.py b/tests/multi_line/test_multi_line.py index b658234..4b63a24 100644 --- a/tests/multi_line/test_multi_line.py +++ b/tests/multi_line/test_multi_line.py @@ -16,7 +16,7 @@ class TestMultiLine(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset([]): 4, diff --git a/tests/nesting/test_nesting.py b/tests/nesting/test_nesting.py index 8f51c6f..76966b9 100644 --- a/tests/nesting/test_nesting.py +++ b/tests/nesting/test_nesting.py @@ -16,7 +16,7 @@ class TestNesting(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset(["CPU"]): 6, diff --git a/tests/once/test_once.py b/tests/once/test_once.py index ae44d01..0e5571a 100644 --- a/tests/once/test_once.py +++ b/tests/once/test_once.py @@ -16,7 +16,7 @@ class TestOnce(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = { frozenset([]): 4, diff --git a/tests/operators/test_operators.py b/tests/operators/test_operators.py index c043f73..7eba420 100644 --- a/tests/operators/test_operators.py +++ b/tests/operators/test_operators.py @@ -17,7 +17,7 @@ class TestOperators(unittest.TestCase): def setUp(self): self.rootdir = Path(__file__).parent.resolve() - logging.getLogger("codebasin").disabled = True + logging.disable() self.expected_setmap = {frozenset(["CPU", "GPU"]): 32} diff --git a/tests/schema/test_schema.py b/tests/schema/test_schema.py index c5b677e..3570263 100644 --- a/tests/schema/test_schema.py +++ b/tests/schema/test_schema.py @@ -14,7 +14,7 @@ class TestSchema(unittest.TestCase): """ def setUp(self): - logging.getLogger("codebasin").disabled = True + logging.disable() def test_compilation_database(self): """schema/compilation_database"""