Skip to content

Conversation

@penguineer
Copy link
Owner

This pull request introduces enhancements to logging and error handling in the app.py script and improves the MqttConfig class in mqtt.py for better debugging. The most significant changes include adding logging for missing labels, printing the MQTT configuration and exit status, and implementing a __str__ method for the MqttConfig class.

Logging and error handling improvements in app.py:

  • Added a warning message in emit_labels to log cases where a label is missing for a specific chip and feature. (app.py, app.pyL33-R42)
  • Added a print statement in main to display the MQTT configuration being used, aiding in debugging. (app.py, app.pyR65)
  • Added a print statement in main to indicate when the application is exiting. (app.py, app.pyR91-R96)

Debugging enhancement in mqtt.py:

  • Added a __str__ method to the MqttConfig class to provide a human-readable string representation of the configuration, making it easier to debug. (mqtt.py, mqtt.pyR28-R30)

@penguineer penguineer added the enhancement New feature or request label Apr 17, 2025
@penguineer penguineer requested a review from Copilot April 17, 2025 10:18
@penguineer penguineer self-assigned this Apr 17, 2025
Copy link

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 enhances logging and debugging by introducing more verbose output for configuration issues and application shutdown, and improves the MQTT configuration's debuggability by adding a str method.

  • Emit a warning when a label is missing by printing a message that includes chip and feature names.
  • Print the current MQTT configuration and exit status in the main function.
  • Add a human-readable str method to the MqttConfig class.

Reviewed Changes

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

File Description
mqtt.py Added a str method to improve debugging by formatting the MQTT configuration string.
app.py Updated label emission to print a missing label message, and added print statements for debugging in main.

Copy link

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.

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

@penguineer penguineer merged commit 390b59f into master Apr 17, 2025
1 check passed
@penguineer penguineer deleted the print-config branch April 17, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants