[chirp_devel] [PATCH] Remove "naked" logging of exceptions #5357

Christopher Hoover
Sun Nov 19 11:48:29 PST 2017


# HG changeset patch
# User Christopher Hoover <ch at murgatroid.com>
# Date 1511120888 28800
#      Sun Nov 19 11:48:08 2017 -0800
# Node ID f2823ff4f5e6e00e8dd6fc33d310d8e80936dfe2
# Parent  fd6871c5064f6d1f80d33e12e05cc671a05652ce
Remove "naked" logging of exceptions #5357

diff -r fd6871c5064f -r f2823ff4f5e6 chirp/detect.py
--- a/chirp/detect.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/detect.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/ft1d.py
--- a/chirp/drivers/ft1d.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/ft1d.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/kenwood_hmk.py
--- a/chirp/drivers/kenwood_hmk.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/kenwood_hmk.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/kenwood_itm.py
--- a/chirp/drivers/kenwood_itm.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/kenwood_itm.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/rfinder.py
--- a/chirp/drivers/rfinder.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/rfinder.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/thd72.py
--- a/chirp/drivers/thd72.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/thd72.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/uv5r.py
--- a/chirp/drivers/uv5r.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/uv5r.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/drivers/vx8.py
--- a/chirp/drivers/vx8.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/drivers/vx8.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/ui/importdialog.py
--- a/chirp/ui/importdialog.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/ui/importdialog.py	Sun Nov 19 11:48:08 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 fd6871c5064f -r f2823ff4f5e6 chirp/ui/memedit.py
--- a/chirp/ui/memedit.py	Sun Nov 05 21:16:23 2017 -0500
+++ b/chirp/ui/memedit.py	Sun Nov 19 11:48:08 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")]



More information about the chirp_devel mailing list