Skip to content

Commit e064edc

Browse files
committed
feat: Add logging to pyshell function
1 parent 1a78032 commit e064edc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

easymotion.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ def get_string_width(s):
1616
return width
1717

1818
def pyshell(cmd):
19-
return os.popen(cmd).read()
19+
# Add logging
20+
with open(os.path.expanduser('~/easymotion.log'), 'a') as log:
21+
log.write(f"{cmd}\n")
22+
result = os.popen(cmd).read()
23+
log.write(f"Result: {result}\n")
24+
log.write("-" * 40 + "\n")
25+
return result
2026

2127
def tmux_pane_id():
2228
# Get the ID of the pane that launched this script

0 commit comments

Comments
 (0)