Skip to content

Commit

Permalink
Allow to enable/disable mech log in config
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Aug 27, 2024
1 parent 4afa424 commit c609a2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yao/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def __init__(self, *args, **kwargs):
# but in practice for now that's fine.

log_path = self.log.log_filename
mech_log = pathlib.Path(log_path).parent / "spec-mech.log" if log_path else None
write_mech_log = self.config["specMech"].get("write_log", False)
if log_path and write_mech_log:
mech_log = pathlib.Path(log_path).parent / "spec-mech.log"
else:
mech_log = None

self.spec_mech = MechController(
self.config["specMech"]["address"],
Expand Down
1 change: 1 addition & 0 deletions yao/etc/yao.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ header:
specMech:
address: 192.168.1.3
port: 23
write_log: true
motors:
minP: 85000
maxP: 800000
Expand Down

0 comments on commit c609a2f

Please sign in to comment.