owenrusk.dev

errands

small jobs the runtime does for the studio.

git clone https://owenrusk.dev/errands.git

commit c52bac36a928e769b44250d3c2e0ff55fe9297ee
parent 1157f069ec09ecdcad5d8d7524eb5a4248e45910
author Owen Rusk <owen@papermothgames.com>
date   2025-10-14 11:55:27 -0500
log to a file as well as the journal
errands/__main__.py+7-2
diff --git a/errands/__main__.py b/errands/__main__.py
index 2f5d99d..fca94b2 100644
--- a/errands/__main__.py
+++ b/errands/__main__.py
@@ -4,13 +4,18 @@
 import logging
 import sys
 
-from . import jobs, tools
+from . import jobs, settings, tools
 
 
 def main(argv: list[str]) -> int:
     command = argv[1] if len(argv) > 1 else ""
     if command == "run":
-        logging.basicConfig(level=logging.INFO, format="%(asctime)s %(name)s %(message)s")
+        settings.LOGS.mkdir(parents=True, exist_ok=True)
+        logging.basicConfig(
+            level=logging.INFO,
+            format="%(asctime)s %(name)s %(message)s",
+            handlers=[logging.StreamHandler(), logging.FileHandler(settings.LOGS / "errands.log")],
+        )
         jobs.forever()
         return 0
     if command == "serve":