feat(gts): make store logging opt-in - #14
Conversation
Before this change, GtsStore always wrote a log line for every entity registration and validation. This polluted the logs of any application that uses the library. Now these logs are off by default. You can turn them on with the new Verbose flag in RegistryConfig. The gts CLI works as before: -v turns on store logging. The server prints store logs at -verbose 1 and above, so -verbose 0 is now really silent.
📝 WalkthroughWalkthroughThe GTS store adds a ChangesVerbose registry logging
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
gts/registry_test.go (1)
30-66: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the new validation log branches.
This test verifies creation and registration only. Add focused silent and verbose cases for
ValidateSchemaandValidateInstanceWithXGtsRefso every new logging path is covered.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gts/registry_test.go` around lines 30 - 66, The TestVerboseLogging test currently covers only store creation and entity registration. Extend it with focused silent-by-default and verbose subtests that invoke ValidateSchema and ValidateInstanceWithXGtsRef, asserting no validation logs with default configuration and the expected validation log messages when RegistryConfig.Verbose is true.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@gts/registry_test.go`:
- Around line 30-66: The TestVerboseLogging test currently covers only store
creation and entity registration. Extend it with focused silent-by-default and
verbose subtests that invoke ValidateSchema and ValidateInstanceWithXGtsRef,
asserting no validation logs with default configuration and the expected
validation log messages when RegistryConfig.Verbose is true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6fa3fdd7-295b-4374-a84b-06ecf574b240
📒 Files selected for processing (4)
cmd/gts-server/main.gocmd/gts/helpers.gogts/registry_test.gogts/store.go
Before this change, GtsStore always wrote a log line for every entity registration and validation. This polluted the logs of any application that uses the library. Now these logs are off by default. You can turn them on with the new Verbose flag in RegistryConfig.
The gts CLI works as before: -v turns on store logging. The server prints store logs at -verbose 1 and above, so -verbose 0 is now really silent.
Summary by CodeRabbit
New Features
Bug Fixes
Tests