Skip to content

Commit cecef9e

Browse files
committed
chore: adjust logging a bit
1 parent babf1a5 commit cecef9e

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/lgtm_ai/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def review(target: PRUrl | LocalRepository, config: str | None, verbose: int, **
169169
"`--compare` option is only used when reviewing a local repository. Ignoring the provided value."
170170
)
171171

172-
logger.info("lgtm-ai version: %s", __version__)
172+
logger.debug("lgtm-ai version: %s", __version__)
173173
logger.debug("Parsed PR URL: %s", target)
174174
logger.info("Starting review of %s", target.full_url)
175175
resolved_config = ConfigHandler(
@@ -241,7 +241,7 @@ def guide(
241241
logger.error("Review guides can only be generated for Pull Request URLs, not local repositories.")
242242
raise click.Abort()
243243

244-
logger.info("lgtm-ai version: %s", __version__)
244+
logger.debug("lgtm-ai version: %s", __version__)
245245
logger.debug("Parsed PR URL: %s", target)
246246
logger.info("Starting generating guide of %s", target.full_url)
247247
resolved_config = ConfigHandler(
@@ -287,7 +287,7 @@ def _set_logging_level(logger: logging.Logger, verbose: int) -> None:
287287
logger.setLevel(logging.INFO)
288288
else:
289289
logger.setLevel(logging.DEBUG)
290-
logger.info("Logging level set to %s", logging.getLevelName(logger.level))
290+
logger.debug("Logging level set to %s", logging.getLevelName(logger.level))
291291

292292

293293
def _get_formatter_and_printer(output_format: OutputFormat) -> tuple[Formatter[Any], Callable[[Any], None]]:

src/lgtm_ai/git/repository.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ def get_diff_from_local_repo(git_dir: pathlib.Path, *, compare: str = "HEAD") ->
3636
# Get diff based on compare parameter
3737
if compare == "HEAD":
3838
# Working directory changes (git diff)
39+
logger.info("Comparing working directory changes against HEAD")
3940
diff_index = repo.head.commit.diff(None, create_patch=True)
4041
target_branch = "HEAD"
4142
else:
4243
# Compare current branch against specified compare (git diff compare..HEAD)
44+
logger.info("Comparing HEAD of %s against %s", current_branch, compare)
4345
try:
4446
compare_commit = repo.commit(compare)
4547
diff_index = compare_commit.diff(repo.head.commit, create_patch=True)

src/lgtm_ai/review/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def get_issues_context(
126126
) -> IssueContent | None:
127127
"""Retrieve the contents of the issue/user story linked to the PR, if any."""
128128
if not self._issues_client:
129-
logger.warning("Issues client is not configured, cannot retrieve issue context")
129+
logger.info("Issues client is not configured, won't retrieve issue context")
130130
return None
131131
issue_code = self._extract_issue_code_from_metadata(pr_metadata, issues_regex)
132132
if not issue_code:

0 commit comments

Comments
 (0)