Improve logging
This commit is contained in:
parent
9bf30cd97a
commit
fccc727c42
3 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,8 @@ class BubaAnimation:
|
|||
def run(self):
|
||||
pass
|
||||
|
||||
def __repr__(self):
|
||||
return f"<{type(self).__name__}>"
|
||||
|
||||
class BubaTime(BubaAnimation):
|
||||
def __init__(self, buba: BubaCmd):
|
||||
|
|
|
@ -15,7 +15,7 @@ class BubaCmd:
|
|||
self.display = None
|
||||
if not path.exists(serial):
|
||||
self.serial = None
|
||||
logging.warning(f"Unable to find serial port '{serial}', ignoring")
|
||||
self.log.warning(f"Unable to find serial port '{serial}', ignoring")
|
||||
if self.serial is not None:
|
||||
self.display = MIS1TextDisplay(serial)
|
||||
self.send = send
|
||||
|
|
|
@ -13,6 +13,7 @@ from buba.websocketcomm import WebSocketClients
|
|||
config = AppConfig()
|
||||
if config.debug:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
app = Bottle()
|
||||
if config.debug:
|
||||
|
@ -48,7 +49,7 @@ def websocket_endpoint(ws: WebSocket):
|
|||
while True:
|
||||
m = ws.receive()
|
||||
except Exception as e:
|
||||
logging.debug("error in websocket", exc_info=e)
|
||||
log.debug("error in websocket", exc_info=e)
|
||||
pass
|
||||
finally:
|
||||
websocket_clients.remove(ws)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue