- all the logs done on Exception are now errors (with the exception of few places where the Exception is expected)

This commit is contained in:
Marius Stanciu
2020-12-31 05:56:46 +02:00
committed by Marius
parent da143eb29f
commit 9dfa3b497d
60 changed files with 392 additions and 391 deletions

View File

@@ -325,7 +325,7 @@ class ToolPaint(AppTool, Gerber):
return 'fail'
tooluid = int(item.text())
except Exception as e:
log.debug("Tool missing. Add a tool in the Tool Table. %s" % str(e))
log.error("Tool missing. Add a tool in the Tool Table. %s" % str(e))
return
# update the QLabel that shows for which Tool we have the parameters in the UI form
@@ -341,7 +341,7 @@ class ToolPaint(AppTool, Gerber):
if int(tooluid_key) == tooluid:
self.storage_to_form(tooluid_value['data'])
except Exception as e:
log.debug("ToolPaint ---> update_ui() " + str(e))
log.error("ToolPaint ---> update_ui() " + str(e))
else:
self.ui.tool_data_label.setText(
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("Multiple Tools"))
@@ -354,7 +354,7 @@ class ToolPaint(AppTool, Gerber):
try:
self.form_fields[k].set_value(dict_storage[k])
except Exception as err:
log.debug("ToolPaint.storage.form() --> %s" % str(err))
log.error("ToolPaint.storage.form() --> %s" % str(err))
def form_to_storage(self):
if self.ui.tools_table.rowCount() == 0:
@@ -1090,7 +1090,7 @@ class ToolPaint(AppTool, Gerber):
self.blockSignals(False)
return
except Exception as e:
log.debug(str(e))
log.error(str(e))
self.app.inform.emit('[success] %s' % _("Tool(s) deleted from Tool Table."))
self.blockSignals(False)
@@ -1123,7 +1123,7 @@ class ToolPaint(AppTool, Gerber):
try:
self.paint_obj = self.app.collection.get_by_name(str(self.obj_name))
except Exception as e:
log.debug("ToolPaint.on_paint_button_click() --> %s" % str(e))
log.error("ToolPaint.on_paint_button_click() --> %s" % str(e))
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), self.obj_name))
return
@@ -1540,7 +1540,7 @@ class ToolPaint(AppTool, Gerber):
self.app.plotcanvas.graph_event_disconnect(self.mm)
self.app.plotcanvas.graph_event_disconnect(self.kp)
except Exception as e:
log.debug("ToolPaint.on_key_press() _1 --> %s" % str(e))
log.error("ToolPaint.on_key_press() _1 --> %s" % str(e))
self.app.mp = self.app.plotcanvas.graph_event_connect('mouse_press',
self.app.on_mouse_click_over_plot)
@@ -1564,7 +1564,7 @@ class ToolPaint(AppTool, Gerber):
self.app.tool_shapes.clear(update=True)
except Exception as e:
log.debug("ToolPaint.on_key_press() _2 --> %s" % str(e))
log.error("ToolPaint.on_key_press() _2 --> %s" % str(e))
self.app.mr = self.app.plotcanvas.graph_event_connect('mouse_release',
self.app.on_mouse_click_release_over_plot)
@@ -1594,7 +1594,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as ee:
log.debug("ToolPaint.paint_polygon_worker() Standard --> %s" % str(ee))
log.error("ToolPaint.paint_polygon_worker() Standard --> %s" % str(ee))
elif paint_method == 1: # _("Seed")
try:
# Type(cp) == FlatCAMRTreeStorage | None
@@ -1608,7 +1608,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as ee:
log.debug("ToolPaint.paint_polygon_worker() Seed --> %s" % str(ee))
log.error("ToolPaint.paint_polygon_worker() Seed --> %s" % str(ee))
elif paint_method == 2: # _("Lines")
try:
# Type(cp) == FlatCAMRTreeStorage | None
@@ -1622,7 +1622,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as ee:
log.debug("ToolPaint.paint_polygon_worker() Lines --> %s" % str(ee))
log.error("ToolPaint.paint_polygon_worker() Lines --> %s" % str(ee))
elif paint_method == 3: # _("Laser_lines")
try:
# line = None
@@ -1773,7 +1773,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as ee:
log.debug("ToolPaint.paint_polygon_worker() Laser Lines --> %s" % str(ee))
log.error("ToolPaint.paint_polygon_worker() Laser Lines --> %s" % str(ee))
elif paint_method == 4: # _("Combo")
try:
self.app.inform.emit(_("Painting polygon with method: lines."))
@@ -1810,7 +1810,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as ee:
log.debug("ToolPaint.paint_polygon_worker() Combo --> %s" % str(ee))
log.error("ToolPaint.paint_polygon_worker() Combo --> %s" % str(ee))
if cpoly and cpoly.objects:
return cpoly
@@ -1978,7 +1978,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as e:
log.debug("Could not Paint the polygons. %s" % str(e))
log.error("Could not Paint the polygons. %s" % str(e))
mssg = '[ERROR] %s\n%s' % (_("Could not do Paint. Try a different combination of parameters. "
"Or a different method of Paint"), str(e))
self.app.inform.emit(mssg)
@@ -2023,7 +2023,7 @@ class ToolPaint(AppTool, Gerber):
geo_obj.options['xmax'] = c
geo_obj.options['ymax'] = d
except Exception as ee:
log.debug("ToolPaint.paint_poly.job_init() bounds error --> %s" % str(ee))
log.error("ToolPaint.paint_poly.job_init() bounds error --> %s" % str(ee))
return
# test if at least one tool has solid_geometry. If no tool has solid_geometry we raise an Exception
@@ -2187,7 +2187,7 @@ class ToolPaint(AppTool, Gerber):
except grace:
return "fail"
except Exception as e:
log.debug("Could not Paint the polygons. %s" % str(e))
log.error("Could not Paint the polygons. %s" % str(e))
msg = '[ERROR] %s\n%s' % (_("Could not do Paint. Try a different combination of parameters. "
"Or a different method of Paint"), str(e))
self.app.inform.emit(msg)
@@ -2278,7 +2278,7 @@ class ToolPaint(AppTool, Gerber):
geo_obj.options['xmax'] = c
geo_obj.options['ymax'] = d
except Exception as ee:
log.debug("ToolPaint.paint_poly.job_init() bounds error --> %s" % str(ee))
log.error("ToolPaint.paint_poly.job_init() bounds error --> %s" % str(ee))
return
# Experimental...
@@ -2584,7 +2584,7 @@ class ToolPaint(AppTool, Gerber):
env_obj = env_obj.convex_hull
sel_rect = env_obj.buffer(distance=0.0000001, join_style=base.JOIN_STYLE.mitre)
except Exception as e:
log.debug("ToolPaint.paint_poly_ref() --> %s" % str(e))
log.error("ToolPaint.paint_poly_ref() --> %s" % str(e))
self.app.inform.emit('[ERROR_NOTCL] %s' % _("No object available."))
return
@@ -2726,7 +2726,7 @@ class ToolPaint(AppTool, Gerber):
try:
minx_, miny_, maxx_, maxy_ = bounds_rec(k)
except Exception as e:
log.debug("ToolPaint.bounds() --> %s" % str(e))
log.error("ToolPaint.bounds() --> %s" % str(e))
return
minx = min(minx, minx_)