prod logging

This commit is contained in:
2025-09-30 00:35:27 +02:00
parent 2d3f97cae1
commit 0be71cfddf
3 changed files with 29 additions and 19 deletions

View File

@@ -132,24 +132,28 @@ class CalendarService:
return
try:
cmd = [
khal_path,
"list",
"--json",
"title",
"--json",
"start",
"--json",
"end",
"--json",
"location",
"today",
]
logger.info(f"[Calendar] Running command: {' '.join(cmd)}")
result = subprocess.run(
[
khal_path,
"list",
"--json",
"title",
"--json",
"start",
"--json",
"end",
"--json",
"location",
"today",
],
cmd,
capture_output=True,
text=True,
check=True,
)
logger.info(f"[Calendar] Command stdout: {result.stdout[:200]}...")
logger.info(f"[Calendar] Command stderr: {result.stderr[:200]}...")
if result.stdout.strip():
lines = result.stdout.strip().split("\n")

View File

@@ -82,12 +82,16 @@ class NotmuchService:
try:
# Get unread email count
cmd = [notmuch_path, "count", "tag:unread"]
logger.info(f"[Notmuch] Running command: {' '.join(cmd)}")
result = subprocess.run(
[notmuch_path, "count", "tag:unread"],
cmd,
capture_output=True,
text=True,
check=True,
)
logger.info(f"[Notmuch] Command stdout: '{result.stdout.strip()}'")
logger.info(f"[Notmuch] Command stderr: '{result.stderr.strip()}'")
if result.stdout.strip():
self.unread_count = int(result.stdout.strip())
@@ -146,8 +150,10 @@ class NotmuchWidget(Button):
try:
# Open emacsclient with notmuch function
subprocess.Popen([emacsclient_command, "-c", "-e", "(notmuch)"], start_new_session=True)
logger.info(f"[Notmuch] Opened notmuch in emacsclient with command: {emacsclient_command}")
cmd = [emacsclient_command, "-c", "-e", "(notmuch)"]
logger.info(f"[Notmuch] Running emacsclient command: {' '.join(cmd)}")
subprocess.Popen(cmd, start_new_session=True)
logger.info(f"[Notmuch] Successfully started emacsclient process")
except Exception as e:
logger.error(f"[Notmuch] Failed to open notmuch in emacsclient '{emacsclient_command}': {e}")