-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add inset config option - ability to set log json data
#42
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
base: main
Are you sure you want to change the base?
Conversation
Add feature to allow nesting evlog data into another property
|
@saltytostitos is attempting to deploy a commit to the HRCD Projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions! 🙏 |
saltytostitos
left a comment
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.
Accidentally snuck in another change that shouldn't have been here. Removed this change for another PR.
nitro/plugin.ts
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.
Pull request overview
This PR adds an inset configuration option to evlog that allows nesting log data under a custom property (automatically prefixed with $). This feature is designed for observability platforms like Cloudflare Workers that inject their own root-level metadata, making it easier to separate application logs from platform metadata.
Changes:
- Added
insetconfig option to type definitions, allowing users to specify a property name for nesting logs - Implemented inset logic in the logger that wraps log data when
pretty: falseandinsetis configured - Updated documentation across multiple files explaining the feature, use cases, and platform compatibility warnings
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evlog/src/types.ts | Added inset property to LoggerConfig and defined InsetWideEvent type |
| packages/evlog/src/logger.ts | Implemented inset logic to conditionally nest log data and added global inset variable |
| packages/evlog/src/nuxt/module.ts | Added inset option to Nuxt module configuration with detailed JSDoc |
| packages/evlog/src/nitro/plugin.ts | Added inset config to Nitro plugin interface and initialization |
| packages/evlog/src/index.ts | Exported InsetWideEvent type for public API |
| skills/evlog/references/wide-events.md | Added comprehensive documentation section with examples and important considerations |
| skills/evlog/references/code-review.md | Added code review checklist item for verifying proper inset usage |
| skills/evlog/SKILL.md | Added inset feature documentation and code review guidance |
| apps/docs/content/1.getting-started/2.installation.md | Added installation guide section with configuration examples and warnings |
| README.md | Added inset feature documentation with examples |
| AGENTS.md | Added inset config option to agent reference table |
| bun.lock | Automated lockfile update adding configVersion field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
:) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
☑️ Merged w/upstream. Should be a much cleaner diff now. Sorry about all the GH actions!!! I believe I got everything. |
This PR adds a likely niche enhancement to allow nesting the log data when logging json.
With systems like Cloudflare Observability, that dump tons of logging data, this makes it easy for me to digest and query the data that I'm providing.
config:
Current flat logs
{ "timestamp": "...", "level": "...", "service": "...", ... }With inset: "evlog":
{ "$evlog": { "timestamp": "...", "level": "...", "service": "...", ... }, "$metadata": { // ...cloudflareData { }I don't normally public formal PRs so if you're interested in this one, let me know if there's anything you need.