From dcdcd0a514f2a433bc8de26906eb9ff2f5e50af3 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:49:22 -0600 Subject: [PATCH 1/4] report PID helpful for finding process in a os system monitor --- yaqd-core/yaqd_core/_is_daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index c2940fe..273aa8a 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -13,6 +13,7 @@ import time from typing import Dict, List, Optional, Any from abc import ABC +from os import getpid import platformdirs # type: ignore import tomli @@ -210,6 +211,7 @@ def main(cls): @classmethod async def _main(cls, config_filepath, config_file, args=None): """Parse command line arguments, start event loop tasks.""" + logger.info(f"PID: {getpid()}") loop = asyncio.get_running_loop() cls.__servers = [] for section in config_file: From 807041798f357d6b6612cdc79e3cc653a3916c72 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 24 Nov 2025 22:29:50 -0600 Subject: [PATCH 2/4] Update CHANGELOG.md --- yaqd-core/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yaqd-core/CHANGELOG.md b/yaqd-core/CHANGELOG.md index 5f8d640..16a6d7f 100644 --- a/yaqd-core/CHANGELOG.md +++ b/yaqd-core/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ## [Unreleased] +### Changed +- logging reports process ID at daemon startup + ### Fixed - type hints for IsSensor attributes are appropriate for _n_-dimensional data From ee63fea9c9f05ed8ba3617caf8a9db9da281d005 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:20:32 -0600 Subject: [PATCH 3/4] Update _is_daemon.py _pid is attribute --- yaqd-core/yaqd_core/_is_daemon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 273aa8a..8b40329 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -211,7 +211,8 @@ def main(cls): @classmethod async def _main(cls, config_filepath, config_file, args=None): """Parse command line arguments, start event loop tasks.""" - logger.info(f"PID: {getpid()}") + cls._pid = getpid() + logger.info(f"PID: {cls._pid}") loop = asyncio.get_running_loop() cls.__servers = [] for section in config_file: From ede38044ee24f527518a03ed6566aca3e54e73f3 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 1 Dec 2025 14:02:07 -0600 Subject: [PATCH 4/4] more logging tweaks --- yaqd-core/yaqd_core/_is_daemon.py | 3 +-- yaqd-core/yaqd_core/_protocol.py | 4 ++-- yaqd-core/yaqd_core/logging/__init__.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 8b40329..a478f3f 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -221,7 +221,7 @@ async def _main(cls, config_filepath, config_file, args=None): try: config = cls._parse_config(config_file, section, args) except ValueError as e: - logger.error(str(e)) + logger.info(str(e)) continue logger.debug(f"Starting {section} with {config}") await cls._start_daemon(section, config, config_filepath) @@ -280,7 +280,6 @@ def _parse_config(cls, config_file, section, args=None): pass if not config.get("enable", True): - logger.info(f"Section '{section}' is disabled") raise ValueError(f"Section '{section}' is disabled") return config diff --git a/yaqd-core/yaqd_core/_protocol.py b/yaqd-core/yaqd_core/_protocol.py index 6644a08..fa8df50 100644 --- a/yaqd-core/yaqd_core/_protocol.py +++ b/yaqd-core/yaqd_core/_protocol.py @@ -17,14 +17,14 @@ def __init__(self, daemon, *args, **kwargs): def connection_lost(self, exc): peername = self.transport.get_extra_info("peername") - self.logger.info(f"Connection lost from {peername} to {self._daemon.name}") + self.logger.info(f"Connection with {peername} lost") self.task.cancel() self._daemon._connection_lost(peername) def connection_made(self, transport): """Process an incomming connection.""" peername = transport.get_extra_info("peername") - self.logger.info(f"Connection made from {peername} to {self._daemon.name}") + self.logger.info(f"Connection with {peername} made") self.transport = transport self.unpacker = avrorpc.Unpacker(self._avro_protocol) self._daemon._connection_made(peername) diff --git a/yaqd-core/yaqd_core/logging/__init__.py b/yaqd-core/yaqd_core/logging/__init__.py index 5161e6f..67b7d24 100644 --- a/yaqd-core/yaqd_core/logging/__init__.py +++ b/yaqd-core/yaqd_core/logging/__init__.py @@ -48,7 +48,7 @@ formatter = logging.Formatter( "{levelname} : {asctime} : {name} : {message}", - datefmt="%Y-%m-%dT%H:%M:%S%z", + datefmt="%Y-%m-%dT%H:%M:%S", style="{", )