Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to per-module loggers #109

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codebasin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from codebasin import CompilationDatabase, util

log = logging.getLogger("codebasin")
log = logging.getLogger(__name__)


def extract_defines(argv):
Expand Down
2 changes: 1 addition & 1 deletion codebasin/file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion codebasin/file_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codebasin/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion codebasin/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion codebasin/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from codebasin import util

log = logging.getLogger("codebasin")
log = logging.getLogger(__name__)


def extract_platforms(setmap):
Expand Down
2 changes: 1 addition & 1 deletion codebasin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import jsonschema

log = logging.getLogger("codebasin")
log = logging.getLogger(__name__)


def compute_file_hash(fname):
Expand Down
2 changes: 1 addition & 1 deletion tests/basic_asm/test_basic_asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion tests/basic_fortran/test_basic_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/build-dir/test_build_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/code-base/test_code_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/commented_directive/test_commented_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion tests/compilers/test_compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestCompilers(unittest.TestCase):
"""

def setUp(self):
logging.getLogger("codebasin").disabled = True
logging.disable()

def test_clang(self):
"""compilers/clang"""
Expand Down
2 changes: 1 addition & 1 deletion tests/define/test_define.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/disjoint/test_disjoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion tests/duplicates/test_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/exclude/test_exclude.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/include/test_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/literals/test_literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion tests/macro_expansion/test_macro_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_line/test_multi_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/nesting/test_nesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/once/test_once.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/operators/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
2 changes: 1 addition & 1 deletion tests/schema/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
Loading