-
Notifications
You must be signed in to change notification settings - Fork 21
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
refactor: Clean up debug prints #53
base: master
Are you sure you want to change the base?
Conversation
.gitignore
Outdated
@@ -90,3 +90,5 @@ ENV/ | |||
|
|||
# IDE | |||
.idea/ | |||
|
|||
*.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should add this. If we add more example equipment responses in the future is going to just make it harder to get them added in the commits.
src/pyeconet/api.py
Outdated
_LOGGER.debug(_json) | ||
if _LOGGER.getEffectiveLevel() == logging.DEBUG: | ||
_LOGGER.debug("Logging json to locations_debug.json") | ||
with open('locations_debug.json', 'w') as debug_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this library is used in Home Assistant where will this file be written? Seems like it will result in making it more difficult to get logs from users.
Update json to print in easy to read format, adjust large json debug to write to file instead of print (and gitignore json files)
Good feedback, I was not considering HA logging. Does the formatted |
Not sure I'd assume it would but maybe not? |
Looks good in the |
Updated to change error message to debug on econet errors |
Update json to print in easy to read format, adjust large json debug to write to file instead of print (and gitignore json files)