[chirp_devel] Fwd: [PATCH] Remove "naked" logging of exceptions
Christopher Hoover
Sat Nov 18 16:04:50 PST 2017
# HG changeset patch
# User Christopher Hoover <ch at murgatroid.com>
# Date 1510452023 28800
# Sat Nov 11 18:00:23 2017 -0800
# Node ID 554ce6091c6ddeeafac4a832cdd56f7a4041f679
# Parent 0e0470d3e892bfd4818bfb972b8b85d58f2b00d4
Remove "naked" logging of exceptions.
Changes all instances of log.error(e) where e is a caught exception to
provide context in the log, so as to make it trival to track down
problems (such as split(None) in memedit).
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/detect.py
--- a/chirp/detect.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/detect.py Sat Nov 11 18:00:23 2017 -0800
@@ -43,7 +43,7 @@
md = icf.get_model_data(ser)
return _icom_model_data_to_rclass(md)
except errors.RadioError, e:
- LOG.error(e)
+ LOG.error("_detect_icom_radio: %s", e)
# ICOM IC-91/92 Live-mode radios @ 4800/38400 baud
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/ft1d.py
--- a/chirp/drivers/ft1d.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/ft1d.py Sat Nov 11 18:00:23 2017 -0800
@@ -1844,7 +1844,7 @@
try:
element.run_apply_callback()
except NotImplementedError as e:
- LOG.error(e)
+ LOG.error("ft1d.set_settings: %s", e)
continue
# Find the object containing setting.
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/kenwood_hmk.py
--- a/chirp/drivers/kenwood_hmk.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/kenwood_hmk.py Sat Nov 11 18:00:23 2017 -0800
@@ -125,7 +125,7 @@
if not good:
for e in errors:
- LOG.error(e)
+ LOG.error("kenwood_hmk: %s", e)
raise errors.InvalidDataError("No channels found")
@classmethod
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/kenwood_itm.py
--- a/chirp/drivers/kenwood_itm.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/kenwood_itm.py Sat Nov 11 18:00:23 2017 -0800
@@ -129,7 +129,7 @@
if not good:
for e in errors:
- LOG.error(e)
+ LOG.error("kenwood_itm: %s", e)
raise errors.InvalidDataError("No channels found")
@classmethod
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/rfinder.py
--- a/chirp/drivers/rfinder.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/rfinder.py Sat Nov 11 18:00:23 2017 -0800
@@ -262,7 +262,7 @@
import traceback
LOG.error(traceback.format_exc())
LOG.error("Error in received data, cannot continue")
- LOG.error(e)
+ LOG.error("rfinder.parse_data: %s", e)
LOG.error(self.__cheat)
LOG.error(line)
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/thd72.py
--- a/chirp/drivers/thd72.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/thd72.py Sat Nov 11 18:00:23 2017 -0800
@@ -558,7 +558,7 @@
try:
element.run_apply_callback()
except NotImplementedError as e:
- LOG.error(e)
+ LOG.error("thd72: %s", e)
continue
# Find the object containing setting.
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/uv5r.py
--- a/chirp/drivers/uv5r.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/uv5r.py Sat Nov 11 18:00:23 2017 -0800
@@ -514,7 +514,7 @@
data = _do_ident(radio, magic)
return data
except errors.RadioError, e:
- LOG.error(e)
+ LOG.error("uv5r._ident_radio: %s", e)
error = e
time.sleep(2)
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/drivers/vx8.py
--- a/chirp/drivers/vx8.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/drivers/vx8.py Sat Nov 11 18:00:23 2017 -0800
@@ -1398,7 +1398,7 @@
try:
element.run_apply_callback()
except NotImplementedError as e:
- LOG.error(e)
+ LOG.error("vx8.set_settings: %s", e)
continue
# Find the object containing setting.
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/ui/importdialog.py
--- a/chirp/ui/importdialog.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/ui/importdialog.py Sat Nov 11 18:00:23 2017 -0800
@@ -266,7 +266,7 @@
"name": name,
"comment": comm})
except import_logic.ImportError, e:
- LOG.error(e)
+ LOG.error("Import error: %s", e)
error_messages[new] = str(e)
continue
diff -r 0e0470d3e892 -r 554ce6091c6d chirp/ui/memedit.py
--- a/chirp/ui/memedit.py Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/ui/memedit.py Sat Nov 11 18:00:23 2017 -0800
@@ -179,7 +179,7 @@
try:
new = chirp_common.parse_freq(new)
except ValueError, e:
- LOG.error(e)
+ LOG.error("chirp_common.parse_freq error: %s", e)
new = None
if not self._features.has_nostep_tuning:
@@ -969,7 +969,7 @@
if i not in default_col_order:
raise Exception()
except Exception, e:
- LOG.error(e)
+ LOG.error("column order setting: %s", e)
col_order = default_col_order
non_editable = [_("Loc")]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20171118/e9e7960e/attachment-0001.html
More information about the chirp_devel
mailing list