Skip to content
Merged
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 packit_service/worker/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ def parse_logdetective_analysis_event(event) -> Optional[logdetective.Result]:
analysis_id=analysis_id
)
if not log_detective_run:
logger.error(
logger.info(
f"Received results Log Detective analysis: '{analysis_id}' "
"but no analysis with this id was requested."
)
Comment on lines +1925 to 1928
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the Repository Style Guide (lines 537-539), when a parser returns None because the event doesn't satisfy specific conditions, a warning must be logged. Changing this log level to info violates this guideline. Please use logger.warning instead.

Suggested change
logger.info(
f"Received results Log Detective analysis: '{analysis_id}' "
"but no analysis with this id was requested."
)
logger.warning(
f"Received results Log Detective analysis: '{analysis_id}' "
"but no analysis with this id was requested."
)
References
  1. Parsers process dictionaries and must either return a parsed object, or None, if the dictionary doesn't satisfy conditions specific to the event. In cases when parser returns None, a warning must be logged. (link)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not true for this parser even before I adjusted this one instance…

Expand Down
Loading