-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[bondhome] Suppress warning messages #15129
Conversation
Signed-off-by: Michael Lobstein <[email protected]>
I'd much rather understand what message you are getting that is not valid JSON. |
Hard to say. I could add the responseJson string to the logging call. I have not seen this often. Maybe it is just when the internet is down, the device is rebooting, etc..? |
Well the BPUPListener is when the device sends us a message. And all communication is local - nothing goes over the internet. So yes, if you could trace log the actual message received locally, then report the next time it happens, then we can decide what to do. Do you need help compiling and installing a custom version of the addon with the extra logging? |
Ok, I will add the extra logging and run it locally. I will report if the error is logged again with the json input. |
The issue has not reoccurred in a weeks time. I looked in my openhab & event logs and noticed that another device (using the shared jetty http client) went offline at the exact same moment. So I think it was a network hiccup that caused the json parse error. I still think this PR should be merged as it brings the use of logging calls closer to what is prescribed by the coding standards. |
@ccutrer : I let you first approve. As this PR is without any risk, we could still merge it in next coming days. |
I'm not sure how this change more closely aligns with the logging standards at https://www.openhab.org/docs/administration/logging.html#defining-what-to-log. In normal operation none of these messages get logged. They're not debug level (because they're not logged under normal operation), and they are useful to a normal end user to pinpoint the problem interacting with their devices. With them a trace level, they may be having trouble controlling their devices or seeing the current device's status, and the log won't have any indication or problems whatsoever. |
I was referring to the coding guidelines for logging: https://www.openhab.org/docs/developer/guidelines.html#f-logging
Where there is an unexpected response from the device and the situation is not recoverable, then error would seems like the correct log to use along with setting the thing status appropriately. If there were a change to the device firmware that caused the code to stop working, some of the current warn logging calls such as when a null deviceId is encountered, would flood the log with the same message over and over again. I think this is why the guidelines call for minimal use of warn and error logging. |
It's already logged in line 232 if you enable debug level: Lines 230 to 242 in f8968b7
|
@ccutrer, @mlobstein - should we try to reach a conclusion? 🙂 We can probably agree that |
If there is some sort of persistent problem reported by a user in the forums, the advice is given almost universally to turn on debug or trace logging. Thus it made sense to me to prevent the logging of spurious errors at the warn level. The messages to be changed are more aligned to the definition and usage of debug level messages in the coding guidelines: https://www.openhab.org/docs/developer/guidelines.html#f-logging
|
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.
Thanks for the fix!
Signed-off-by: Michael Lobstein <[email protected]>
Signed-off-by: Michael Lobstein <[email protected]> Signed-off-by: Jørgen Austvik <[email protected]>
I am seeing occasional spurious warning messages from bondhome in my openhab.log like this:
This PR changes almost all warn() logging calls to trace() or debug() to prevent these messages from being logged.