-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: Adapt logs to object format (almost) #38280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughThis PR standardizes logging across multiple server modules by converting string-based log calls to structured object payloads and normalizing catch parameter names from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes The changes follow a single, consistent pattern across 25+ files (string-based logging → structured object logging), making each individual file trivial to review. However, the scope is substantial and includes multiple module areas requiring verification of pattern consistency. The homogeneous nature of changes reduces cognitive load compared to heterogeneous edits. Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #38280 +/- ##
===========================================
- Coverage 70.74% 70.73% -0.02%
===========================================
Files 3142 3142
Lines 108929 108926 -3
Branches 19631 19754 +123
===========================================
- Hits 77064 77047 -17
- Misses 29865 29872 +7
- Partials 2000 2007 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 29 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts">
<violation number="1" location="packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts:322">
P2: Wrapping the caught error in `new Error(...)` discards the original stack/cause, making logs less useful. Log the original Error when available and only create a new Error for non-Error values.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@ee/packages/license/src/license.ts`:
- Around line 355-360: The catch block in the license verification flow logs the
sensitive encryptedLicense payload (see the logger.error call); remove
encryptedLicense from the structured log and instead log only non-sensitive data
such as the error (err) and optionally a non-reversible identifier (e.g., a
SHA-256 hex/hash of encryptedLicense) if you need correlation; update the
logger.error invocation in the catch that currently references encryptedLicense
so it only includes err and an optional safe hash (calculate the hash in the
same scope before logging).
In `@ee/packages/omnichannel-services/src/QueueWorker.ts`:
- Around line 90-93: The log message in QueueWorker.ts incorrectly hardcodes "10
seconds"; update the logger.info in the retry branch (where
queueItem.retryCount, this.retryCount and this.isRetryableError are checked) to
report the actual configured delay (this.retryDelay) instead of "10 seconds" —
e.g., compute and include the delay value (milliseconds or seconds) derived from
this.retryDelay in the message so operators see the true retry delay.
In `@packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts`:
- Around line 321-323: In the catch block inside AppsEngineDenoRuntime (where
logger.error is called with "Failed to restart app's subprocess"), stop wrapping
the caught exception with new Error(...) which discards the original stack;
instead pass the original error object to logger.error (e.g., err: e or err: e
instanceof Error ? e : new Error(String(e))) so the original stack trace is
preserved, and then rethrow the original error as currently done.
🧹 Nitpick comments (1)
apps/meteor/server/services/omnichannel-integrations/providers/twilio.ts (1)
263-266: Inconsistent logging format.This error log still uses a template string format while the rest of this file and the PR converts logs to structured object format. Consider updating for consistency:
Suggested fix
- SystemLogger.error(`(Twilio) -> URL or Twilio token not configured.`); + SystemLogger.error({ msg: '(Twilio) -> URL or Twilio token not configured.' });
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.