Skip to content

feat: support silent mode with deferred drain and config ref page#174

Merged
HugoRCD merged 2 commits intomainfrom
EVL-115
Mar 14, 2026
Merged

feat: support silent mode with deferred drain and config ref page#174
HugoRCD merged 2 commits intomainfrom
EVL-115

Conversation

@HugoRCD
Copy link
Copy Markdown
Owner

@HugoRCD HugoRCD commented Mar 14, 2026

This pull request introduces a new silent mode to the library, allowing users to suppress all console output while still building, sampling, and draining events. It also improves the drain pipeline to prevent duplicate draining in framework integrations and adds a comprehensive configuration reference page to the documentation.
Documentation across all supported frameworks has been updated to reference the new configuration options and central reference.

@HugoRCD HugoRCD requested a review from Copilot March 14, 2026 14:43
@HugoRCD HugoRCD self-assigned this Mar 14, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Ready Ready Preview, Comment, Open in v0 Mar 14, 2026 2:51pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 14, 2026

Thank you for following the naming conventions! 🙏

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 14, 2026

npm i https://pkg.pr.new/evlog@174
npm i https://pkg.pr.new/@evlog/nuxthub@174

commit: 5d9375f

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a silent mode to the evlog logging library that suppresses all console output while still building, sampling, and passing events to drains. It also fixes a drain pipeline issue where framework integrations could double-drain events by introducing a _deferDrain internal option, and adds a central configuration reference page to the documentation.

Changes:

  • New silent option in LoggerConfig and framework-specific option interfaces (Nuxt, Nitro) that gates all console output behind a !globalSilent check
  • Deferred drain mechanism (_deferDrain) to prevent double-draining: framework middleware defers the global drain at emit time and runs its own enrich+drain pipeline with full request context, falling back to getGlobalDrain() when no middleware drain is configured
  • Comprehensive configuration reference doc page and cross-references from all framework guide pages

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/evlog/src/logger.ts Core silent mode flag, getGlobalDrain() export, deferDrain parameter in emitWideEvent, CreateLoggerInternalOptions
packages/evlog/src/types.ts silent field added to LoggerConfig
packages/evlog/src/shared/middleware.ts Uses _deferDrain, falls back to getGlobalDrain() in runEnrichAndDrain
packages/evlog/src/next/handler.ts Uses _deferDrain, falls back to getGlobalDrain() in callEnrichAndDrain
packages/evlog/src/nitro/plugin.ts Passes silent to initLogger, uses _deferDrain
packages/evlog/src/nitro-v3/plugin.ts Passes silent to initLogger, uses _deferDrain
packages/evlog/src/nitro.ts silent field in NitroModuleOptions and EvlogConfig
packages/evlog/src/nuxt/module.ts silent field in ModuleOptions
packages/evlog/test/logger.test.ts Comprehensive tests for silent mode
packages/evlog/test/middleware.test.ts Tests for global drain fallback and no-double-drain
apps/docs/content/3.core-concepts/7.configuration.md New central configuration reference page
apps/docs/content/2.frameworks/*.md Cross-references to configuration page from all framework docs
skills/evlog/SKILL.md, AGENTS.md, packages/evlog/README.md Documentation updates for silent option
.changeset/silent-mode-drain-pipeline.md Changeset for the minor version bump

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@HugoRCD HugoRCD merged commit 396ef78 into main Mar 14, 2026
11 checks passed
@HugoRCD HugoRCD deleted the EVL-115 branch March 14, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants