Skip to content

Commit

Permalink
perf(logging): remove irrelevant debug logging statements (python-sem…
Browse files Browse the repository at this point in the history
…antic-release#1147)

* refactor: adjust logging output
  • Loading branch information
codejedi365 authored Jan 18, 2025
1 parent 7792388 commit f1ef4ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/semantic_release/changelog/release_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def from_git_history(
# commits included, the true reason for a version bump would be missing.
if has_exclusion_match and commit_level_bump == LevelBump.NO_RELEASE:
log.info(
"Excluding commit [%s] %s",
commit.hexsha[:8],
commit_message.replace("\n", " ")[:50],
"Excluding commit[%s] %s",
parse_result.short_hash,
commit_message.split("\n", maxsplit=1)[0][:40],
)
continue

Expand All @@ -145,29 +145,29 @@ def from_git_history(
str.join(
" ",
[
"Excluding commit %s (%s) because parser determined",
"Excluding commit[%s] (%s) because parser determined",
"it should not included in the changelog",
],
),
commit.hexsha[:8],
parse_result.short_hash,
commit_message.replace("\n", " ")[:20],
)
continue

if the_version is None:
log.info(
"[Unreleased] adding '%s' commit(%s) to list",
commit.hexsha[:8],
"[Unreleased] adding commit[%s] to unreleased '%s'",
parse_result.short_hash,
commit_type,
)
unreleased[commit_type].append(parse_result)
continue

log.info(
"[%s] adding '%s' commit(%s) to release",
"[%s] adding commit[%s] to release '%s'",
the_version,
parse_result.short_hash,
commit_type,
commit.hexsha[:8],
)

released[the_version]["elements"][commit_type].append(parse_result)
Expand Down
1 change: 0 additions & 1 deletion src/semantic_release/changelog/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def environment(
autoescape_value = dynamic_import(autoescape)
else:
autoescape_value = autoescape
log.debug("%s", locals())

return ComplexDirectorySandboxedEnvironment(
block_start_string=block_start_string,
Expand Down
2 changes: 1 addition & 1 deletion src/semantic_release/cli/commands/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def is_forced_prerelease(
log.debug(
"%s: %s",
is_forced_prerelease.__name__,
", ".join(f"{k} = {v}" for k, v in local_vars),
str.join(", ", iter(f"{k} = {v}" for k, v in local_vars)),
)
return (
as_prerelease
Expand Down
2 changes: 1 addition & 1 deletion src/semantic_release/cli/masking_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(

def add_mask_for(self, data: str, name: str = "redacted") -> MaskingFilter:
if data and data not in self._UNWANTED:
log.debug("Adding redact pattern %r to _redact_patterns", name)
log.debug("Adding redact pattern '%r' to redact_patterns", name)
self._redact_patterns[name].add(data)
return self

Expand Down
1 change: 0 additions & 1 deletion src/semantic_release/version/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def dfs(start_commit: Commit, stop_nodes: set[Commit]) -> Sequence[Commit]:
# Add all parent commits to the stack from left to right so that the rightmost is popped first
# as the left side is generally the merged into branch
for parent in node.parents:
logger.debug("queuing parent commit %s", parent.hexsha[:7])
stack.put(parent)

return commits
Expand Down

0 comments on commit f1ef4ec

Please sign in to comment.