deerflow2/backend/packages/harness/deerflow/agents/middlewares
moose-lab 03b144f9c9
fix: replace print() with logging across harness package (#1282)
Replace all bare print() calls with proper logging using Python's
standard logging module across the deerflow harness package.

Changes across 8 files (16 print statements replaced):

- agents/middlewares/clarification_middleware.py: use logger.info/debug
- agents/middlewares/memory_middleware.py: use logger.debug
- agents/middlewares/thread_data_middleware.py: use logger.debug
- agents/middlewares/view_image_middleware.py: use logger.debug
- agents/memory/queue.py: use logger.info/debug/warning/error
- agents/lead_agent/prompt.py: use logger.error
- skills/loader.py: use logger.warning
- skills/parser.py: use logger.error

Each file follows the established codebase convention:
  import logging
  logger = logging.getLogger(__name__)

Log levels chosen based on message semantics:
- debug: routine operational details (directory creation, timer resets)
- info: significant state changes (memory queued, updates processed)
- warning: recoverable issues (config load failures, skipped updates)
- error: unexpected failures (parsing errors, memory update errors)

Note: client.py is intentionally excluded as it uses print() for
CLI output, which is the correct behavior for a command-line client.

Co-authored-by: moose-lab <moose-lab@users.noreply.github.com>
2026-03-27 23:15:35 +08:00
..
clarification_middleware.py fix: replace print() with logging across harness package (#1282) 2026-03-27 23:15:35 +08:00
dangling_tool_call_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
deferred_tool_filter_middleware.py feat(tools): add tool_search for deferred MCP tool loading (#1176) 2026-03-17 20:43:55 +08:00
loop_detection_middleware.py feat(harness): integration ACP agent tool (#1344) 2026-03-26 14:20:18 +08:00
memory_middleware.py fix: replace print() with logging across harness package (#1282) 2026-03-27 23:15:35 +08:00
subagent_limit_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
thread_data_middleware.py fix: replace print() with logging across harness package (#1282) 2026-03-27 23:15:35 +08:00
title_middleware.py fix: add sync after_model to TitleMiddleware (#1190) 2026-03-19 15:46:31 +08:00
todo_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
token_usage_middleware.py feat: add configurable log level and token usage tracking (#1301) 2026-03-25 08:13:26 +08:00
tool_error_handling_middleware.py feat(guardrails): add pre-tool-call authorization middleware with pluggable providers (#1240) 2026-03-23 18:07:33 +08:00
uploads_middleware.py fix: add null checks for runtime.context and tighten langgraph constraint (#1326) 2026-03-25 21:01:10 +08:00
view_image_middleware.py fix: replace print() with logging across harness package (#1282) 2026-03-27 23:15:35 +08:00