Skip to content

Commit

Permalink
Save debug log filename
Browse files Browse the repository at this point in the history
vs throwing it away in the logging framework
  • Loading branch information
mutesplash authored Nov 29, 2023
1 parent ea87baf commit 3382963
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buildhat/serinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ def __init__(self, firmware, signature, version, device="/dev/serial0", debug=Fa
self.motorqueue = []
self.fin = False
self.running = True
self.debug_filename = None
if debug:
tmp = tempfile.NamedTemporaryFile(suffix=".log", prefix="buildhat-", delete=False)
self.debug_filename = tmp.name
logging.basicConfig(filename=tmp.name, format='%(asctime)s %(message)s',
level=logging.DEBUG)

Expand Down

0 comments on commit 3382963

Please sign in to comment.