Skip to content

feat: add enabled?: boolean config option to disable logger#69

Merged
HugoRCD merged 5 commits intoHugoRCD:mainfrom
Pastequee:main
Feb 12, 2026
Merged

feat: add enabled?: boolean config option to disable logger#69
HugoRCD merged 5 commits intoHugoRCD:mainfrom
Pastequee:main

Conversation

@Pastequee
Copy link
Copy Markdown
Contributor

🔗 Linked issue

None

📚 Description

Add an { enabled?: boolean } config option that default to true to dynamically disable the logger depending on whatever the user wants.
My main use case here is to disable the logger in test environments like so:
enabled: process.env.NODE_ENV !== 'test'

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Thoughts

I have implemented this is a noop "mock" way, I don't know if its how you would have want to do it, but feel free discard the PR and just consider this as a feature request if you'd like.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 11, 2026

@Pastequee is attempting to deploy a commit to the HRCD Projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 11, 2026

Thank you for following the naming conventions! 🙏

@HugoRCD HugoRCD requested a review from Copilot February 11, 2026 21:30
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

Adds a global enabled?: boolean configuration option (defaulting to true) to allow consumers to fully disable logging behavior across server/client runtimes.

Changes:

  • Introduces enabled?: boolean in logger/module config types and propagates it into Nuxt runtime config.
  • Implements global enable/disable behavior (server + client), including no-op request logger behavior and early return in Nitro plugin.
  • Adds test coverage and updates README/docs to document the new option.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/evlog/src/types.ts Adds enabled?: boolean to LoggerConfig with documentation.
packages/evlog/src/logger.ts Implements global enable flag, exports isEnabled(), and adds a no-op request logger when disabled.
packages/evlog/src/index.ts Re-exports isEnabled.
packages/evlog/src/nitro/plugin.ts Reads enabled from runtime config; returns early when logging disabled.
packages/evlog/src/nuxt/module.ts Adds module option + forwards enabled into public.evlog.
packages/evlog/src/runtime/client/plugin.ts Passes enabled from public runtime config into client logger init.
packages/evlog/src/runtime/client/log.ts Adds client-side enable flag to short-circuit all emits when disabled.
packages/evlog/test/logger.test.ts Adds tests to verify disabled behavior is no-op and enabled behavior unchanged.
packages/evlog/README.md Documents the new enabled option in init example.
apps/docs/content/1.getting-started/2.installation.md Documents enabled in configuration option table.
README.md Documents the new enabled option in init example.
AGENTS.md Documents enabled in configuration option table.
bun.lock Lockfile metadata update (configVersion).

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

Comment on lines 248 to 249
* log.emit()
* ```
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The JSDoc block appears to document createRequestLogger, but it now sits immediately above noopLogger, so tooling will associate the comment with the wrong symbol. Move noopLogger above the JSDoc block (or move/duplicate the JSDoc so it directly precedes createRequestLogger).

Copilot uses AI. Check for mistakes.
Comment thread packages/evlog/src/logger.ts Outdated
Comment thread packages/evlog/README.md Outdated
Comment thread README.md Outdated
HugoRCD and others added 3 commits February 11, 2026 22:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 11, 2026

npm i https://pkg.pr.new/evlog@69

commit: d61661d

@HugoRCD HugoRCD merged commit d61661d into HugoRCD:main Feb 12, 2026
10 of 11 checks passed
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.

3 participants