Consolidate console logging to structured logger utility#935
Conversation
Replace all console.log, console.warn, and console.error calls in packages/core/src with the structured logger utility from logger.ts. This provides consistent, filterable logging with OpenTelemetry integration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 7c9d7c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (169 failed)mongodb (42 failed):
redis (42 failed):
starter (43 failed):
turso (42 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
There was a problem hiding this comment.
Pull request overview
This PR consolidates all console logging calls in packages/core/src to use a structured logger utility built on the debug library with OpenTelemetry integration. This provides consistent, filterable logging and removes duplicate logging patterns.
Changes:
- Replaced all
console.log,console.warn, andconsole.errorcalls with structured loggers (runtimeLogger,stepLogger) that accept structured metadata - Removed duplicate logging where both
eventsLoggerandconsole.errorwere called for the same event - Updated test expectations to remove console spy mocking since logging is now handled by the structured logger
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/telemetry.ts | Replaced console.warn with runtimeLogger.warn for OpenTelemetry unavailable warning |
| packages/core/src/serialization.ts | Replaced console.error calls with runtimeLogger.error, adding structured metadata for serialization failures |
| packages/core/src/runtime/suspension-handler.ts | Replaced console.warn calls with runtimeLogger.warn, adding structured context including workflowRunId and correlationId |
| packages/core/src/runtime/step-handler.ts | Replaced console.error/warn calls with stepLogger equivalents, converting formatted error stack strings to structured metadata |
| packages/core/src/runtime.ts | Replaced console.warn/error calls with runtimeLogger equivalents, adding structured metadata for workflow status and errors |
| packages/core/src/observability.ts | Replaced console.error with runtimeLogger.error for event data hydration errors |
| packages/core/src/events-consumer.ts | Removed duplicate console.error call, keeping only eventsLogger.error for callback errors |
| packages/core/src/events-consumer.test.ts | Removed console.error spy test code that is no longer needed since duplicate logging was removed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Logger now outputs error/warn to console (always visible, not just when DEBUG enabled) - Downgrade warn → info for expected states (OTel unavailable, workflow/step already completed, idempotency cases) - Downgrade error → warn for transient failures (step invoked erroneously, error with retry pending) - Remove verbose debug logs from hot paths (events-consumer) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
karthikscale3
left a comment
There was a problem hiding this comment.
tested and looks good
…-parallelization * origin/main: Add x-workflow-run-id header to queue messages (#922) Bump Next.js and React in workbenches (#944) Add subpath export resolution for package IDs (#901) Consolidate console logging to structured logger utility (#935) # Conflicts: # packages/core/src/runtime/step-handler.ts
Summary
console.log,console.warn, andconsole.errorcalls inpackages/core/srcwith the structured logger utility fromlogger.tsDEBUGenv var was setLog Level Changes
Test plan
pnpm buildin packages/core)pnpm testin packages/core)[Workflow]prefixconsole.calls in source files (only logger.ts and JSDoc examples)🤖 Generated with Claude Code