Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use LOGGER.error for debug logging during scene entities check #380

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

Sirs0ri
Copy link
Contributor

@Sirs0ri Sirs0ri commented Oct 2, 2023

Description

Change a LOGGER.error statement that's not used to log an error to a more approproate debug statement.

Motivation and Context

I new errors in my HA log after installing spook, and after I'd fixed all the repairs. Since the error's title was just Scene: scene.one_of_my_scenes, repeated multiple times for each scene, I checked the code and noticed that every time a scene's entities are scanned for missing entities (e.g. when saving a scene), the scene's id is logged as error. This PR changes the message's log level to debug.

How has this been tested?

  1. changed the file locally
  2. deleted the corresponding pycache file
  3. restarted HomeAssistant
  4. changed a scene, to see if the log's gone
  5. error is no longer logged!
  6. reverted the change locally, then repeated 2.-4. to check that the error comes back, which it does

Screenshots (if appropriate):

grafik

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

The changed line is only used to print the currently inspected scene's name. Using LOGGER.error for this will spam the log with a meaningless message. LOGGER.debug fits much better.
@Sirs0ri Sirs0ri changed the title fix: don't use LOGGER.error for debug logging during scene entities check bugfix: don't use LOGGER.error for debug logging during scene entities check Oct 2, 2023
@frenck frenck changed the title bugfix: don't use LOGGER.error for debug logging during scene entities check Don't use LOGGER.error for debug logging during scene entities check Oct 2, 2023
@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Oct 2, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Owner

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @Sirs0ri 👍

../Frenck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants