Skip to content

Conversation

@jimmyjon711
Copy link
Collaborator

@jimmyjon711 jimmyjon711 commented Dec 18, 2025

Major Changes in this PR

Adds check to verify that log file was passed into klipper service before trying to create AFC.log file

  • Does not log to file if log file was not passed into service

Fixes #593

How the changes in this PR are tested

Removed passing in log file to klipper service to replicate and verify fix

Logging to stdout instead
image

With fix implemented, no logging to stdout when log file is supplied
image

PR Checklist: (Checked-off items are either done or do not apply to this PR)

  • I have performed a self-review of my code
  • CHANGELOG.md is updated (if end-user facing)
  • Documentation updated in AT-Documentation repository
  • Sent notification to software-design/software-discussions channel (as appropriate) requesting review
  • If this PR address a GitHub issue, the issue number is referenced in the PR description

NOTE: GitHub Copilot may be used for automated code reviews, however as it is an automated system, it's suggestions
may not be correct. Please do not rely on it to catch all issues. Please review any suggestions it makes and use your
own judgement to determine if they are correct.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a safeguard to prevent errors when the Klipper service does not receive a log file parameter. The fix checks if a log file path is provided before attempting to create the AFC.log file, and falls back to using the root logger when no log file is specified.

Key changes:

  • Modified logger initialization to check for the presence of log_file in printer start arguments
  • Added conditional logic to handle cases where logging to file is not possible

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
extras/AFC_logger.py Added conditional check for log_file parameter and fallback to root logger when not provided
CHANGELOG.md Documented the fix for the log file error

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jimmyjon711 jimmyjon711 merged commit 7244033 into ArmoredTurtle:DEV Dec 22, 2025
1 check passed
@jimmyjon711 jimmyjon711 deleted the issue_593 branch December 22, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AFC_logger.py assumes klippy log file exists

1 participant