chore(observability): prefix log lines with an ISO-8601 UTC timestamp#962
chore(observability): prefix log lines with an ISO-8601 UTC timestamp#962shgew wants to merge 2 commits into
Conversation
Prefix every log line emitted by logger.fmt, bootLog, and bootWarn with an ISO-8601 UTC timestamp: <iso> [agentmemory] <level> <msg>. Quiet-mode buffered boot lines stay plain to keep the CLI summary clean. Docker logs and any persisted log file now carry per-line timestamps for downstream tail/grep/log-aggregator work. Tests: test/logger.test.ts (new file) covers info/warn/error, field serialization, non-serializable fallback, bootWarn, and verbose bootLog. Signed-off-by: Hleb Shauchenka <me@marleb.org>
|
@shgew is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesTimestamp-prefixed log formatting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
test/logger.test.ts (1)
53-60: ⚡ Quick winAdd a quiet-mode regression test for
bootLog.Please add a case asserting
setBootVerbose(false)+bootLog(...)does not callprocess.stderr.write; this guards the stated contract that quiet boot lines stay buffered/non-timestamped.🤖 Prompt for 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. In `@test/logger.test.ts` around lines 53 - 60, Add a new test case after the existing verbose bootLog test that verifies the quiet-mode behavior of bootLog. In this test, call setBootVerbose(false), then call bootLog with a test message, and assert that the stderr spy mock was not called (or has zero calls), confirming that quiet boot lines do not write to stderr but remain buffered instead.
🤖 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.
Nitpick comments:
In `@test/logger.test.ts`:
- Around line 53-60: Add a new test case after the existing verbose bootLog test
that verifies the quiet-mode behavior of bootLog. In this test, call
setBootVerbose(false), then call bootLog with a test message, and assert that
the stderr spy mock was not called (or has zero calls), confirming that quiet
boot lines do not write to stderr but remain buffered instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7ba7847a-90eb-497e-803a-c67dc8696281
📒 Files selected for processing (2)
src/logger.tstest/logger.test.ts
The verbose-mode test asserted the stderr write happens; this adds the counterpart asserting setBootVerbose(false) + bootLog() does NOT touch stderr, locking in the buffered/non-timestamped contract.
What
Prefix every log line emitted by
logger.fmt,bootLog, andbootWarnwith an ISO-8601 UTC timestamp:Quiet-mode buffered boot lines stay plain to keep the CLI summary clean.
Why
Docker logs and any persisted log file now carry per-line timestamps for downstream tail/grep/log-aggregator work. Without per-line timestamps, multi-container or multi-process log streams cannot be merged chronologically.
Tests
test/logger.test.ts(new file, 5 cases): info, warn, error, field serialization, non-serializable fallback, bootWarn, verbose bootLog. Targeted suite: 5/5 pass.Compatibility
Format change for runtime log lines. CLI summary unchanged. No env changes.
Summary by CodeRabbit