diff --git a/src/specify_cli/events/__init__.py b/src/specify_cli/events/__init__.py index 613dba5702..4b0a6c8173 100644 --- a/src/specify_cli/events/__init__.py +++ b/src/specify_cli/events/__init__.py @@ -316,10 +316,10 @@ def _run_inline(command_name, payload, project_root, timeout, envelope="plain", return result.returncode return 0 except subprocess.TimeoutExpired: - print(f"Event {command_name} timed out", file=sys.stderr) + logger.error("Event %s timed out", command_name) return 2 except Exception as e: - print(f"Event {command_name} error: {e}", file=sys.stderr) + logger.error("Event %s error: %s", command_name, e) return 2 @@ -1371,9 +1371,8 @@ def install_integration_events( if ev in canonical_to_native: filtered[ev] = handlers else: - print( - f"\u26a0\ufe0f {integration.key} does not support '{ev}' events; skipping", - file=sys.stderr, + logger.warning( + "%s does not support '%s' events; skipping", integration.key, ev, ) # #3: an empty resolved map (--events false, or override disabling events) diff --git a/tests/integrations/test_integration_vibe.py b/tests/integrations/test_integration_vibe.py index c2189a4b84..6be90136f6 100644 --- a/tests/integrations/test_integration_vibe.py +++ b/tests/integrations/test_integration_vibe.py @@ -217,14 +217,14 @@ def test_wildcard_matcher_omitted(self, tmp_path): (hook,) = self._parse(tmp_path)["hooks"] assert "match" not in hook - def test_unsupported_events_are_skipped(self, tmp_path, capsys): + def test_unsupported_events_are_skipped(self, tmp_path, caplog): self._install(tmp_path, { "session_start": [{"command": "speckit.agent-context.update"}], "pre_tool_use": [{"command": "speckit.tdd.validate"}], }) hooks = self._parse(tmp_path)["hooks"] assert [h["type"] for h in hooks] == ["pre_tool"] - assert "does not support 'session_start'" in capsys.readouterr().err + assert "does not support 'session_start'" in caplog.text def test_multiple_handlers_get_unique_names(self, tmp_path): """Vibe drops duplicate hook names, so shared command stems must not collide."""