Skip to content

feat(log): set Abseil's level from a go-plugin level - #4

Merged
devgianlu merged 1 commit into
mainfrom
feat/absl-level
Sep 29, 2026
Merged

devgianlu merged 1 commit into
mainfrom
feat/absl-level

Conversation

@devgianlu

@devgianlu devgianlu commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

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 VLOG verbosity. It also had to map debug and trace to the same verbosities InstallAbslBridge reads them from. Otherwise a debug line would be reported as trace, or the reverse.

go_plugin::log::SetAbslLevel(level) does that in one call:

level Abseil minimum severity VLOG verbosity
trace info trace_from_verbosity
debug info trace_from_verbosity - 1
info info 0
warn warning 0
error error 0

It also calls SetLevel, so lines written through Write follow the same level. The bridge records the trace_from_verbosity it was installed with, which keeps the mapping consistent with custom AbslBridgeOptions.

The test checks that one call decides what Abseil lets through: VLOG(1) and VLOG(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

  • New Features
    • Added SetAbslLevel to 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.
    • Documented support for plugins whose host changes the logging level at runtime.

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>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 9b0e86c5-4902-4335-accf-352eaa445ef5

📥 Commits

Reviewing files that changed from the base of the PR and between 86cef96 and 575f702.

📒 Files selected for processing (4)
  • README.md
  • include/go_plugin/log_absl.hpp
  • src/log_absl.cpp
  • tests/test_log_absl.cpp

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.


📝 Walkthrough

Walkthrough

The Abseil bridge adds SetAbslLevel(Level min) to set the plugin log level and configure Abseil severity and VLOG filtering. The README documents the API, and tests check filtering at Debug, Trace, and Warn.

Changes

Abseil logging level control

Layer / File(s) Summary
Public API and documentation
include/go_plugin/log_absl.hpp, README.md
The header declares and documents SetAbslLevel(Level min). The README describes its use when a host changes logging levels at runtime.
Level mapping and validation
src/log_absl.cpp, tests/test_log_absl.cpp
The implementation stores the bridge trace verbosity and maps the selected level to Abseil severity and VLOG settings. Tests check captured logs and the plugin level.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 575f7

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a way to set Abseil's logging level from a go-plugin logging level.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

@devgianlu
devgianlu merged commit cddfd3f into main Sep 29, 2026
2 checks passed
@devgianlu
devgianlu deleted the feat/absl-level branch September 29, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant