Skip to content

Commit d41dce5

Browse files
committed
Log stderr if something is in stderr
closes #96 and solves future issues like #95
1 parent e745612 commit d41dce5

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

app/appdata/modules/API/MDNX/crunchy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def test(self) -> None:
7373
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
7474
log_manager.info(f"MDNX API test result:\n{result.stdout}")
7575

76+
if result.stderr:
77+
log_manager.warning(f"MDNX API test result (stderr):\n{result.stderr}")
78+
7679
dict_result = self._process_console_output(result.stdout, add2queue=False)
7780
log_manager.info(f"Processed console output:\n{json.dumps(dict_result)}")
7881

@@ -99,6 +102,9 @@ def auth(self) -> str:
99102
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
100103
log_manager.info(f"Console output for auth process:\n{result.stdout}")
101104

105+
if result.stderr:
106+
log_manager.warning(f"Console output for auth process (stderr):\n{result.stderr}")
107+
102108
log_manager.info(f"Authentication with {self.mdnx_service} complete.")
103109
return result.stdout
104110

@@ -111,6 +117,9 @@ def start_monitor(self, series_id: str) -> str:
111117
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
112118
log_manager.debug(f"Console output for start_monitor process:\n{result.stdout}")
113119

120+
if result.stderr:
121+
log_manager.warning(f"Console output for start_monitor process (stderr):\n{result.stderr}")
122+
114123
self._process_console_output(result.stdout)
115124

116125
log_manager.debug(f"Monitoring for series with ID: {series_id} complete.")
@@ -132,6 +141,9 @@ def update_monitor(self, series_id: str) -> str:
132141
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
133142
log_manager.debug(f"Console output for update_monitor process:\n{result.stdout}")
134143

144+
if result.stderr:
145+
log_manager.warning(f"Console output for update_monitor process (stderr):\n{result.stderr}")
146+
135147
self._process_console_output(result.stdout)
136148

137149
log_manager.debug(f"Updating monitor for series with ID: {series_id} complete.")

app/appdata/modules/API/MDNX/hidive.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def test(self) -> None:
7979
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
8080
log_manager.info(f"MDNX API test result:\n{result.stdout}")
8181

82+
if result.stderr:
83+
log_manager.warning(f"MDNX API test result (stderr):\n{result.stderr}")
84+
8285
dict_result = self._process_console_output(result.stdout, add2queue=False)
8386
log_manager.info(f"Processed console output:\n{json.dumps(dict_result)}")
8487

@@ -110,6 +113,9 @@ def auth(self) -> str:
110113
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
111114
log_manager.info(f"Console output for auth process:\n{result.stdout}")
112115

116+
if result.stderr:
117+
log_manager.warning(f"Console output for auth process (stderr):\n{result.stderr}")
118+
113119
log_manager.info(f"Authentication with {self.mdnx_service} complete.")
114120
return result.stdout
115121

@@ -122,6 +128,9 @@ def start_monitor(self, series_id: str) -> str:
122128
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
123129
log_manager.debug(f"Console output for start_monitor process:\n{result.stdout}")
124130

131+
if result.stderr:
132+
log_manager.warning(f"Console output for start_monitor process (stderr):\n{result.stderr}")
133+
125134
self._process_console_output(result.stdout)
126135

127136
log_manager.debug(f"Monitoring for series with ID: {series_id} complete.")
@@ -143,6 +152,9 @@ def update_monitor(self, series_id: str) -> str:
143152
result = subprocess.run(tmp_cmd, capture_output=True, text=True, encoding="utf-8")
144153
log_manager.debug(f"Console output for update_monitor process:\n{result.stdout}")
145154

155+
if result.stderr:
156+
log_manager.warning(f"Console output for update_monitor process (stderr):\n{result.stderr}")
157+
146158
self._process_console_output(result.stdout)
147159

148160
log_manager.debug(f"Updating monitor for series with ID: {series_id} complete.")

0 commit comments

Comments
 (0)