feat: Add JSON logging wrapper for STUNner#210
feat: Add JSON logging wrapper for STUNner#210ChaturvediShilpa wants to merge 1 commit intol7mp:mainfrom
Conversation
This PR adds a non-invasive JSON logging wrapper that converts STUNner's plain text logs to structured JSON format without modifying the STUNner codebase. Key features: - Zero code changes to STUNner required - Uses slog to redirect standard log output to JSON - Captures all Pion logging framework output - Preserves rate limiting and log levels - Production-ready implementation Files added: - cmd/stunner-wrapper/: Complete wrapper implementation - Documentation and tests included - Go version compatibility explained The wrapper works by redirecting Go's standard log package to slog, which converts all log output to structured JSON format. Since STUNner uses the standard log package internally through Pion, this approach works without any modifications to the STUNner codebase.
Pull Request Test Coverage Report for Build 16568249087Details
💛 - Coveralls |
|
Thanks for bringing this up, this is a much requested feature. Unfortunately the current approach is not acceptable for merging. Duplicating The correct approach would be to tackle this upstream in pion/logging. Actually it seems you've already tried that and get rejected due to Golang incompatibility. I'd recommend you keep pushing that PR since that's the right way to have this feature merged. The best would be to find some If you're absolutely failing on the upstream merge path you can also try to implement structured logging as a drop-in replacement for Overall, I'm afraid whatever you do will be only a half-solution: pion/logging, and everything on top of it like STUNner, is built-around Anyway, thanks for pushing this, we truly appreciate your effort. ps: Please exercise more care when trying to merge obviously AI-generated code into open source projects. (Judging from the excess use of emojis in your PR docs this must be Claude Sonnet or some variant.) Don't get me wrong, AI-generated code is perfectly fine with us, we're also using AIs all the time. But before submitting please make sure you properly review the code and remove all AI BS (like |
This PR adds a non-invasive JSON logging wrapper that converts STUNner's plain text logs to structured JSON format without modifying the STUNner codebase.
Key features:
Files added:
The wrapper works by redirecting Go's standard log package to slog, which converts all log output to structured JSON format. Since STUNner uses the standard log package internally through Pion, this approach works without any modifications to the STUNner codebase.