mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
AppModule was routing `Log.e` vs `Log.w` vs `Log.i` by string-matching
message prefixes ("Audit:", "TunnelClient: disconnected:"). Severity is
known at the call site, not at wiring. Renaming a log string silently
downgraded severity, and "frame arrived after disconnect" landed as WARN
despite the spec calling for DEBUG.
Introduce `LogLevel { DEBUG, INFO, WARN, ERROR }` in both `:core:mcp` and
`:core:tunnel` (duplicated to avoid a cross-module dependency on a
four-value enum). Change `log: (String) -> Unit` to
`log: (LogLevel, String) -> Unit` on `ConnectionStateMachine`,
`TunnelClientImpl`, `MuxDemux`, `configureMcpRouting`, `McpSession`, and
the audit-emission helpers. Each call site declares its own severity.
AppModule's lambda becomes a simple `when (level)` switch onto
`android.util.Log`. The emitted log tags and severities are unchanged
for existing events; "frame arrived after disconnect" now correctly
lands at DEBUG.
Tests capture `Pair<LogLevel, String>` and assert the expected level.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| screenshots | ||
| src | ||
| build.gradle.kts | ||
| google-services.json | ||
| proguard-rules.pro | ||