feat(openclaw): surface gatewayLogLevel from openclaw.json (#5060) - #5061
Conversation
Add _read_logging_level_config() (mirrors _read_logging_file_config pattern) and propagate the result as gatewayLogLevel in _gateway_log_meta(), so operators can see why lower-severity events are absent from the tailed log. Closes #5060 Co-Authored-By: ClawMetry Autofix Bot <bot-autofix@clawmetry.dev>
|
Autonomous maintainer pass (2026-08-22): draft assessment. Code quality: clean. CI: 26/27 checks complete, all green. One still running: "Entitlement API tests" (started 06:29 UTC — this check ran ~12 min on the previous PR and passed; no entitlement code changes in this PR). Recommendation: once "Entitlement API tests" completes green, this is ready to mark ready-for-review and merge. No conflicts with the other open PR (#5055 touches different files). Value is clear — operators can now see Generated by Claude Code |
✅ Drift Bot (ClawMetry): no drift detectedDrift Bot analyzed the changed files against this project's blueprints and requirements and found no drift. |
Summary
Operators couldn't tell from the ClawMetry dashboard why lower-severity events were absent from the tailed gateway log. The
_gateway_log_meta()function already surfaced log dir, archive count, and current file size — but silently omitted the configured minimum file-log level fromopenclaw.json.This adds
gatewayLogLevelto the metadata dict whenlogging.levelis set inopenclaw.json.Changes
clawmetry/adapters/openclaw.py: Add_read_logging_level_config()helper (mirrors the existing_read_logging_file_config()pattern — same OPENCLAW_HOME fallback,~/.clawdbotalt path, graceful empty-string return, never raises). Call it in_gateway_log_meta()and propagate the result asgatewayLogLevelwhen non-empty.tests/test_obs_gap_logging_level_5060.py: 8 tests covering_read_logging_level_config()(present/absent/malformed config, case normalisation) and_gateway_log_meta()level propagation (included when configured, omitted when not).Test plan
python3 -m pytest tests/test_obs_gap_logging_level_5060.py -q— all 8 pass (verified locally)python3 -c 'import ast; ast.parse(open("clawmetry/adapters/openclaw.py").read())'— syntax OK (verified){"logging": {"level": "warn"}}inopenclaw.json, restart ClawMetry, confirmgatewayLogLevel: "warn"appears in the detect/health JSON responseBot meta
Draft PR opened autonomously based on the plan in #5060. Marked draft for human review — mark Ready for Review once happy.
Closes #5060
Generated by Claude Code