Docs: keep the log-level split where both files say it is - #1579
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughLogging documentation now describes worker threshold propagation and CANN-owned onboard severity. Testing documentation reorganizes log-level configuration guidance, adds CLI examples, and links detailed behavior to the logging configuration documentation. ChangesLogging documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@docs/logging.md`:
- Around line 278-281: Update the dlog_setlevel guidance in the CANN logging
documentation to state that it must be called before the device context is
opened; calls made after device initialization do not affect device-side
logging. Keep the existing ASCEND_GLOBAL_LOG_LEVEL and dlog_setlevel
configuration details unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cbf21621-9dcd-4819-be36-1bc047976a53
📒 Files selected for processing (2)
docs/logging.mddocs/testing.md
55d6a54 to
373ec15
Compare
`logging.md` opens by pointing at `testing.md § Log levels` for the user-facing model and claiming implementation for itself; `testing.md § Log levels` points back for implementation. The split is declared in both directions, and neither file held it — testing.md carried the `simpler_log_init` / `HostLogger` / `InitArgs` chain, the `cann_level()` mapping, and the fork-time threshold propagation, all of which are mechanism, and logging.md restated the snapshot semantics. testing.md now answers only what a test author needs: what the levels are, which macro lands where, how to set the threshold, and the two consequences — the threshold is snapshotted once at `Worker.init()`, and onboard AICPU severity comes from CANN, where a pre-set `ASCEND_GLOBAL_LOG_LEVEL` wins. logging.md gains what moved: the CANN mapping as a table under Configuration flow, plus the forked-subprocess rule, which was documented nowhere else — the parent snapshots before `fork()` and passes the value explicitly to `_chip_process_loop` rather than letting the child re-read a logger it never configured. Both files now also state the deadline for configuring CANN severity by hand: it must happen before `Worker.init()`. `init_log_switch()` reads CANN once at the top of the AICPU init kernel and latches the result into `g_is_log_enable_*`; every later `LOG_*` tests those flags and never asks CANN again, and that kernel runs inside `Worker.init()`. A `dlog_setlevel` after that call silently does nothing to device-side logging. Not a size reduction: testing.md loses 6 lines and logging.md gains 37. The point is that one topic now has one owner per aspect, so a change like hw-native-sys#1475 has one place to land instead of two. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
docs/logging.mdopens withand
docs/testing.md § Log levelspoints back for implementation details. The split is declared in both directions. Neither file held it:simpler_log_init/HostLogger/InitArgschain, thecann_level()→ CANN mapping, and the fork-time threshold propagation — all mechanism, in the file that says it is not about mechanism.That is the shape that produces a doc which silently lies: #1475 retired the verbose V-tiers and had two places to land.
After
testing.md answers only what a test author needs — the integer layout, the macro→level table, how to set the threshold, and the two consequences:
Worker.init(), sologger.setLevel(...)afterwards does not reach a live worker;ASCEND_GLOBAL_LOG_LEVELwins over the Python logger.logging.md gains what moved, under
## Configuration flow:timingandwarnboth → CANN WARN, which is why the default threshold does not open CANN's INFO stream);ASCEND_GLOBAL_LOG_LEVEL-wins rule;fork()and pass it explicitly to_chip_process_loop, rather than letting the child re-read a logger it never configured.Not a size reduction
testing.md loses 8 lines (788 → 780); logging.md gains 30 (282 → 312). The gain is that one topic now has one owner per aspect. testing.md is still 780 lines / 16 H2 and well past the soft target in
.claude/rules/doc-consistency.md§6 — splitting it is a separate decision, not folded in here.Testing
mkdocs build --strictpassesmarkdownlint-cli2 --config tests/lint/.markdownlint.yaml— 0 errors on both fileslogging.md#configuration-flowandtesting.md#log-levels(neither heading renamed)dlog_setlevel/cann_level()insrc/common/platform/*/host/c_api_shared.cpp, the--log-levelchoices inconftest.pyDocs only.