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

Resolved Issue - Update logger initialization to use module-specific loggers #140 #143

Merged
merged 1 commit into from
Jul 29, 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
4 changes: 2 additions & 2 deletions src/tirith/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from .core import start_policy_evaluation

# TODO: Use at least __name__ for the logger name
logger = logging.getLogger()

logger = logging.getLogger(__name__)


def eprint(*args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions src/tirith/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from .evaluators import EVALUATORS_DICT


# TODO: Use __name__ for the logger name instead of using the root logger
logger = logging.getLogger()

logger = logging.getLogger(__name__)


def get_evaluator_inputs_from_provider_inputs(provider_inputs, provider_module, input_data):
Expand Down
3 changes: 1 addition & 2 deletions src/tirith/core/evaluators/contained_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: At least add __name__ as the name for the logger
logger = logging.getLogger()
logger = logging.getLogger(__name__)

# Checks if :attr: `evaluator_input` is contained in :attr:`evaluator_data`.

Expand Down
4 changes: 2 additions & 2 deletions src/tirith/core/evaluators/contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: At least add __name__ as the name for the logger
logger = logging.getLogger()

logger = logging.getLogger(__name__)

# Checks if :attr: `evaluator_input` is contained in :attr:`evaluator_data`.

Expand Down
3 changes: 1 addition & 2 deletions src/tirith/core/evaluators/equals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: Use __name__ for the logger name instead of using the root logger
logger = logging.getLogger()
logger = logging.getLogger(__name__)

# Checks if :attr:`value` is equal to :attr:`other`. Automatically casts values to the same type if possible.

Expand Down
4 changes: 2 additions & 2 deletions src/tirith/core/evaluators/not_contained_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: At least add __name__ as the name for the logger
logger = logging.getLogger()

logger = logging.getLogger(__name__)

# Checks if :attr: `evaluator_input` is not contained in :attr:`evaluator_data`.

Expand Down
4 changes: 2 additions & 2 deletions src/tirith/core/evaluators/not_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: At least add __name__ as the name for the logger
logger = logging.getLogger()

logger = logging.getLogger(__name__)

# Checks if :attr: `evaluator_input` does not contain :attr:`evaluator_data`.

Expand Down
3 changes: 1 addition & 2 deletions src/tirith/core/evaluators/not_equals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections

# TODO: Use __name__ for the logger name instead of using the root logger
logger = logging.getLogger()
logger = logging.getLogger(__name__)

# Checks if :attr:`value` is not equal to :attr:`other`. Automatically casts values to the same type if possible.

Expand Down
3 changes: 1 addition & 2 deletions src/tirith/providers/infracost/handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging

# TODO: Add at least __name__ as the name of the logger
logger = logging.getLogger()
logger = logging.getLogger(__name__)


def __get_all_costs(operation_type, input_data):
Expand Down
4 changes: 2 additions & 2 deletions src/tirith/providers/sg_workflow/handler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

# TODO: Add at least __name__ as the name of the logger
logger = logging.getLogger()

logger = logging.getLogger(__name__)


def __getValue(key, data):
Expand Down
2 changes: 1 addition & 1 deletion src/tirith/providers/terraform_plan/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _get_exp_attribute(split_expressions, input_data):
final_data.append(val)
return final_data


def provide(provider_inputs, input_data):
# """Provides the value of the attribute from the input_data"""
outputs = []
Expand Down
2 changes: 1 addition & 1 deletion src/tirith/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

logger = logging.getLogger()
logger = logging.getLogger(__name__)


def sort_collections(inputs):
Expand Down
Loading