[modules/publicip] add nicer logging

This commit is contained in:
tobi-wan-kenobi 2022-08-31 19:09:04 +02:00
parent 05f0e08493
commit 0f74b690ca

View file

@ -36,6 +36,9 @@ import core.decorators
import util.format import util.format
import util.location import util.location
import logging
log = logging.getLogger(__name__)
class Module(core.module.Module): class Module(core.module.Module):
@ -140,10 +143,10 @@ class Module(core.module.Module):
core.event.trigger("update", [widget.module.id], redraw_only=True) core.event.trigger("update", [widget.module.id], redraw_only=True)
except Exception as ex: except Exception as ex:
widget.set("public_ip", None) widget.set("public_ip", None)
print(ex) logging.error(str(ex))
def state(self, widget): def state(self, widget):
return widget.get("state", None) return widget.get("state", None)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4