chore(worker): Reduce logger verbosity#1179
Conversation
This comment has been minimized.
This comment has been minimized.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughReduce logging verbosity by changing multiple backend and web informational ChangesLog Level Downgrades
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 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 docstrings
🧪 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.
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 `@packages/backend/src/zoekt.ts`:
- Around line 43-47: The stderr output from the exec callback is being logged at
debug via logger.debug, which hides non-fatal warnings from zoekt-git-index;
change the stderr handling in the exec callback (the block that currently calls
stderr.split(...).forEach(line => logger.debug(line))) to log each non-empty
stderr line at warn (or info) level instead, include a short contextual prefix
like "zoekt-git-index:" or "zoekt index warning" in the message so it's clear in
logs, and otherwise keep the same splitting/filtering logic.
🪄 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
Run ID: 1ececb4a-c189-41e4-af07-5c8b4f25557e
📒 Files selected for processing (9)
CHANGELOG.mdpackages/backend/src/api.tspackages/backend/src/configManager.tspackages/backend/src/connectionManager.tspackages/backend/src/ee/auditLogPruner.tspackages/backend/src/index.tspackages/backend/src/repoIndexManager.tspackages/backend/src/zoekt.tspackages/web/src/app/api/(server)/health/route.ts
| if (stderr) { | ||
| stderr.split('\n').filter(line => line.trim()).forEach(line => { | ||
| // TODO: logging as regular info here and not error because non error logs are being | ||
| // streamed in stderr and incorrectly being logged as errors at a high level | ||
| logger.info(line); | ||
| logger.debug(line); | ||
| }); | ||
| } |
There was a problem hiding this comment.
stderr from zoekt-git-index should stay at warn (or info) to preserve observability of non-fatal indexing issues.
zoekt-git-index (like most CLI tools) emits non-fatal warnings — e.g., files skipped due to size, permission issues, branch resolution problems — to stderr while still exiting with code 0. The exec callback only rejects on a non-zero exit code (line 33), so the stderr log is the only production signal for these warnings. Downgrading it to debug makes them invisible at default log levels and will make diagnosing partial indexing failures harder.
🔧 Suggested fix: log stderr at `warn` level
if (stderr) {
stderr.split('\n').filter(line => line.trim()).forEach(line => {
- logger.debug(line);
+ logger.warn(line);
});
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (stderr) { | |
| stderr.split('\n').filter(line => line.trim()).forEach(line => { | |
| // TODO: logging as regular info here and not error because non error logs are being | |
| // streamed in stderr and incorrectly being logged as errors at a high level | |
| logger.info(line); | |
| logger.debug(line); | |
| }); | |
| } | |
| if (stderr) { | |
| stderr.split('\n').filter(line => line.trim()).forEach(line => { | |
| logger.warn(line); | |
| }); | |
| } |
🤖 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 `@packages/backend/src/zoekt.ts` around lines 43 - 47, The stderr output from
the exec callback is being logged at debug via logger.debug, which hides
non-fatal warnings from zoekt-git-index; change the stderr handling in the exec
callback (the block that currently calls stderr.split(...).forEach(line =>
logger.debug(line))) to log each non-empty stderr line at warn (or info) level
instead, include a short contextual prefix like "zoekt-git-index:" or "zoekt
index warning" in the message so it's clear in logs, and otherwise keep the same
splitting/filtering logic.
Summary by CodeRabbit