incorrect log

This commit is contained in:
Evan
2025-12-19 17:59:01 +00:00
parent 3a1ab9ad36
commit 3edb452f5b
2 changed files with 3 additions and 2 deletions

View File

@@ -24,6 +24,8 @@ class _InterceptHandler(logging.Handler):
except ValueError:
level = record.levelno
return
logger.opt(depth=3, exception=record.exc_info).log(level, record.getMessage())

View File

@@ -197,8 +197,8 @@ class InfoGatherer:
async with await open_process(
[macmon_path, "pipe", "--interval", str(self.macmon_interval * 1000)]
) as p:
logger.critical("MacMon closed stdout")
if not p.stdout:
logger.critical("MacMon closed stdout")
return
async for text in TextReceiveStream(p.stdout):
await self.info_sender.send(MacmonMetrics.from_raw_json(text))
@@ -215,4 +215,3 @@ class InfoGatherer:
logger.warning(
f"MacMon failed with return code {e.returncode}: {stderr_msg}"
)