Skip to content

Commit

Permalink
Update arduino_exec.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ripred committed Jan 18, 2024
1 parent 8df845b commit 6f20830
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arduino_exec.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
"""
arduino_exec.py
Expand Down Expand Up @@ -98,9 +99,10 @@ def setup_logger():
# Set up logging configuration
logging.basicConfig(level=logging.ERROR) # Set the logging level to ERROR

file_name = 'bang.log'
file_handler = logging.FileHandler(
os.path.join(os.path.abspath(os.path.dirname(__file__)),
'arduino_exec.log'))
file_name))
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
file_handler.setFormatter(formatter)

Expand Down Expand Up @@ -368,6 +370,7 @@ def run():
continue

logtext = f"Received command from Arduino: '{arduino_command}'"
print(logtext)
logger.info(logtext)

cmd_id = arduino_command[0] # Extract the first character
Expand Down

0 comments on commit 6f20830

Please sign in to comment.