feat(log): set Abseil's level from a go-plugin level - #4
Conversation
A host that moves a plugin's level while it runs names one of go-plugin's five levels. A plugin logging through Abseil had to translate that into Abseil's minimum severity and a VLOG verbosity itself, and get debug and trace the same way round as the bridge that reports them. SetAbslLevel does it: debug and trace become the VLOG verbosities InstallAbslBridge's trace_from_verbosity maps them from, warn and error become Abseil's minimum severity, and Write follows as well. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe Abseil bridge adds ChangesAbseil logging level control
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This adds a function that lets a host set the plugin log level through Abseil. No merge-blocking risk was found in the supplied changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1 unsupported.)
Comment |
A host can change a plugin's log level while the plugin runs, and it names one of go-plugin's five levels when it does. A plugin that logs through Abseil had to turn that level into two Abseil settings itself: a minimum severity and a
VLOGverbosity. It also had to map debug and trace to the same verbositiesInstallAbslBridgereads them from. Otherwise a debug line would be reported as trace, or the reverse.go_plugin::log::SetAbslLevel(level)does that in one call:VLOGverbositytrace_from_verbositytrace_from_verbosity - 1It also calls
SetLevel, so lines written throughWritefollow the same level. The bridge records thetrace_from_verbosityit was installed with, which keeps the mapping consistent with customAbslBridgeOptions.The test checks that one call decides what Abseil lets through:
VLOG(1)andVLOG(2)at debug and at trace, and info against warning at warn. The README documents the function next to the bridge.🤖 Generated with Claude Code
Summary by CodeRabbit
SetAbslLevelto control the minimum severity for plugin and Abseil logging. Debug and trace levels also configure the corresponding Abseil verbose logging, while warning and error levels set their matching minimum severities.