Skip to content

Commit 5796dd6

Browse files
committed
add stderr to custom error output
1 parent 33cca34 commit 5796dd6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

watchdog/process_starter.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
import subprocess
44
import shlex
55
import importlib
6+
from typing import Callable
67

78
from backend.deployment.util import RunnableModule
89

910

11+
import io
12+
13+
14+
class StderrLogger(io.StringIO):
15+
def log_func(self, message: str):
16+
error(message)
17+
18+
1019
def get_all_modules() -> list[RunnableModule]:
1120
backend_deploy = importlib.import_module("backend.deploy")
1221
backend_deploy = importlib.reload(backend_deploy)
@@ -39,4 +48,5 @@ def start_process(process_name: str, config_path: str):
3948
text=True,
4049
bufsize=1,
4150
universal_newlines=True,
51+
stderr=StderrLogger(),
4252
)

0 commit comments

Comments
 (0)