chore(worker): update worker warnings AGT-2909#5771
Conversation
| logger.warning( | ||
| f"failed to connect to livekit, retrying in {retry_delay}s", exc_info=e | ||
| f"failed to connect to livekit, retrying in {retry_delay}s", | ||
| extra={"retry_count": retry_count, "max_retry": self._max_retry, "error": e}, | ||
| ) |
There was a problem hiding this comment.
🟡 Removal of exc_info loses exception traceback in connection retry warning logs
The change from exc_info=e to extra={"error": e} removes the full exception traceback from the warning log. With exc_info=e, Python's logging framework includes the complete traceback (showing causal chain, file/line info, etc.), which is critical for debugging why connections fail (DNS resolution errors, TLS failures, connection refused, etc.). With extra={"error": e}, only str(e) is included via the JsonFormatter.JsonEncoder (cli/log.py:98-99), losing the traceback entirely. Both exc_info and extra can be passed simultaneously to logger.warning(), so the new structured fields (retry_count, max_retry) can be added without sacrificing the traceback.
| logger.warning( | |
| f"failed to connect to livekit, retrying in {retry_delay}s", exc_info=e | |
| f"failed to connect to livekit, retrying in {retry_delay}s", | |
| extra={"retry_count": retry_count, "max_retry": self._max_retry, "error": e}, | |
| ) | |
| logger.warning( | |
| f"failed to connect to livekit, retrying in {retry_delay}s", | |
| exc_info=e, | |
| extra={"retry_count": retry_count, "max_retry": self._max_retry}, | |
| ) |
Was this helpful? React with 👍 or 👎 to provide feedback.
| msg.type, | ||
| extra={ | ||
| "type": msg.type.name, | ||
| "ws_extra": msg.extra, |
There was a problem hiding this comment.
I think printing the data may even be more spammy?
I would only print it for error messages
There was a problem hiding this comment.
Do we send any non-error text messages?
No description provided.