feat(logger): support VSAG_LOG_LEVEL#2414
Conversation
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Require kind label
🟢 Require version label
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to configure the log level of the built-in logger using the VSAG_LOG_LEVEL environment variable, including updates to English and Chinese documentation, implementation of a case-insensitive log level parser, and comprehensive unit tests. The reviewer feedback suggests avoiding virtual function calls in the constructor by directly updating the atomic log level, adding a length guard to the parser to prevent unnecessary allocations, and supporting as well as documenting the "off" log level to completely disable logging.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Adds support for configuring the built-in vsag::DefaultLogger log level via a VSAG_LOG_LEVEL environment variable, and documents this behavior in the API “Resource” docs (EN/ZH). This fits into VSAG’s runtime configuration surface by allowing users to adjust default logging verbosity without changing code.
Changes:
- Added
VSAG_LOG_LEVELparsing atDefaultLoggerconstruction time with support fortrace,debug,info,warn/warning,error,critical(invalid values are ignored). - Added unit tests covering env-driven level selection, alias handling, invalid input fallback, and explicit
SetLeveloverride behavior. - Documented
VSAG_LOG_LEVELusage in English and Chinese API resource docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/impl/logger/default_logger.h | Declares an explicit DefaultLogger() constructor to enable env-based initialization. |
| src/impl/logger/default_logger.cpp | Implements VSAG_LOG_LEVEL parsing and applies the parsed level during logger construction. |
| src/impl/logger/default_logger_test.cpp | Adds Catch2 tests and small RAII helpers for env/stream capture to validate new behavior. |
| docs/docs/en/src/api/resource.md | Documents VSAG_LOG_LEVEL behavior and supported values (EN). |
| docs/docs/zh/src/api/resource.md | Documents VSAG_LOG_LEVEL behavior and supported values (ZH). |
Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com> Assisted-by: Codex:GPT-5
21c2be6 to
c0de6ba
Compare
|
/assign @wxyucs |
|
/label S-ready-to-merge |
|
Tick the box to add this pull request to the merge queue (same as
|
Change Type
Linked Issue
Not applicable for
kind/improvement; no issue was provided.What Changed
VSAG_LOG_LEVELparsing for the built-inDefaultLogger.trace,debug,info,warn/warning,error, andcritical.infolevel remains in effect.Test Evidence
make fmtmake lintmake testmake cov, run tests, and collect coverageTest details:
Compatibility Impact
VSAG_LOG_LEVELwhen it is constructed; explicitSetLevelcalls still override it.Performance and Concurrency Impact
Documentation Impact
README.mdDEVELOPMENT.mdCONTRIBUTING.mddocs/docs/en/src/api/resource.md,docs/docs/zh/src/api/resource.mdRisk and Rollback
Checklist
kind/bugandkind/feature; see "Linked Issue" above)[skip ci]prefix)