servo: quiet down init errors
This change does two things to help ease nerves and avoid unnecessary
worries.
(1) it quiets down the error logging when a hwinit fails. Instead of
printing a trace it simply prints that there's an error and gently
nudges the user to file a bug. The debug logs still have the trace-back
(2) specifically if cr50 is unresponsive, it also prints that maybe the
servo might not have read/write access. Hopefully for v2 users that
starts the right questions i.e. "does my servo have cr50 console
access".
BUG=b:122688221
TEST=manual testing
emerge hdctools -j32
2019-06-20 10:22:19,959 - CPU - EC3PO.Console - INFO - /dev/pts/92 -
Disabling uart timestamps.
2019-06-20 10:22:22,951 - cr50 - WARNING - Consider checking whether the
servo device has read/write access to the Cr50 UART console.
2019-06-20 10:22:22,951 - Servod - ERROR - Problem initializing
cr50_version -> print
2019-06-20 10:22:22,951 - Servod - ERROR - Cannot retrieve the version
result on cr50 console. cr50 uart is unresponsive
2019-06-20 10:22:22,951 - Servod - ERROR - Please consider verifying the
logs and if the error is not just a setup issue, consider filing a bug.
Also checkout go/servo-ki.
2019-06-20 10:22:22,960 - ServoDeviceWatchdog - INFO - Watchdog setup
for devices: set([(6353, 20482, '906533-00189')])
2019-06-20 10:22:22,961 - servod - INFO - Listening on localhost port
9999
Change-Id: I5652998ec60e63b8edc5701c829d772aa3074eee
Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1669199
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/servo/servo_server.py b/servo/servo_server.py
index 51cbf1a..ebbf6ca 100755
--- a/servo/servo_server.py
+++ b/servo/servo_server.py
@@ -807,9 +807,13 @@
self.set(control_name, value)
if verbose:
self._logger.info('Initialized %s to %s', control_name, value)
- except Exception:
- self._logger.exception(
+ except Exception as e:
+ self._logger.error(
'Problem initializing %s -> %s', control_name, value)
+ self._logger.error(str(e))
+ self._logger.error('Please consider verifying the logs and if the '
+ 'error is not just a setup issue, consider filing '
+ 'a bug. Also checkout go/servo-ki.')
return True