Skip to content

Commit ae7ba73

Browse files
authored
refactor: format lightman output (#41)
1 parent 21cacc0 commit ae7ba73

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/lightman_ai/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ def run(
9595
project_key=config_from_file.service_desk_project_key,
9696
request_id_type=config_from_file.service_desk_request_id_type,
9797
)
98-
relevant_articles_titles = [article.title for article in relevant_articles]
99-
logger.warning("Found these articles: %s", "\n".join(relevant_articles_titles))
98+
relevant_articles_metadata = [f"{article.title} ({article.link})" for article in relevant_articles]
99+
logger.warning("Found these articles: \n- %s", "\n- ".join(relevant_articles_metadata))
100100
return 0

src/lightman_ai/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ async def schedule_task(article: SelectedArticle) -> None:
3434
description=article.link,
3535
request_id_type=request_id_type,
3636
)
37+
logger.info("Created issue for article %s", article.link)
3738
except Exception:
3839
logger.exception("Could not create ServiceDesk issue: %s, %s", article.title, article.link)
3940
raise
@@ -73,9 +74,9 @@ def lightman(
7374
score_threshold
7475
)
7576
if selected_articles:
76-
logger.warning("Found these articles: %s", selected_articles)
77+
logger.info("Found these articles: %s", selected_articles)
7778
else:
78-
logger.warning("No articles found to be relevant. Total returned articles by AI %s", len(classified_articles))
79+
logger.info("No articles found to be relevant. Total returned articles by AI %s", len(classified_articles))
7980

8081
if not dry_run:
8182
if not project_key or not request_id_type:

0 commit comments

Comments
 (0)