Skip to content

fix(logging): prevent duplicate OpenTAKServer log lines - #359

Draft
fallenmi wants to merge 1 commit into
brian7704:masterfrom
fallenmi:agent/fix-duplicate-log-propagation
Draft

fix(logging): prevent duplicate OpenTAKServer log lines#359
fallenmi wants to merge 1 commit into
brian7704:masterfrom
fallenmi:agent/fix-duplicate-log-propagation

Conversation

@fallenmi

Copy link
Copy Markdown

Summary

  • stop the shared OpenTAKServer logger from propagating records to the root logger
  • add a behavioral regression test proving the named handler receives one record while the root handler receives none

Root cause

OpenTAKServer configures handlers directly on its named logger, but the logger retained Python's default propagate=True. When a dependency or runtime also configured the root logger, the same record was emitted by both handler chains.

The named logger's existing file and TTY handlers are unchanged. In non-TTY environments, this intentionally removes the accidental bare root/stderr copy while preserving the configured file output.

Validation

  • regression test confirmed failing before the source change and passing after it
  • .venv/bin/python -m pytest -q (1 passed, 1 skipped)
  • .venv/bin/python -m black --check opentakserver/extensions.py tests/test_logging.py
  • .venv/bin/python -m isort --check-only opentakserver/extensions.py tests/test_logging.py
  • .venv/bin/python -m flake8 opentakserver/extensions.py tests/test_logging.py

Thanks to @TX-RX for the clear report and suggested direction.

Fixes #304

Generated-by: OpenAI Codex (GPT-5)

Generated-by: OpenAI Codex (GPT-5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate log lines: every OTS log message appears twice (named logger + propagated root)

1 participant