Skip to content

feat: Dependency-inject custom logger into sidecar#226

Merged
Lms24 merged 3 commits into
mainfrom
lms/feat-sideacar-logger
Dec 5, 2023
Merged

feat: Dependency-inject custom logger into sidecar#226
Lms24 merged 3 commits into
mainfrom
lms/feat-sideacar-logger

Conversation

@Lms24
Copy link
Copy Markdown
Member

@Lms24 Lms24 commented Dec 5, 2023

closes #201

This PR adjusts setupSidecar to

  • accept an options object instead of just the port number
  • inject a custom logger via the options object
  • use a common logger interface and object that invokes the default logger or the custom logger if passed in

Furthermore, this PR:

  • updates the Astro Spotlight package to use the Astro inegration logger for the side car
  • updates the CLI and Vite plugin APIs for manually using the sidecar

Ultimately, this PR also demots some log/info level logs about receiving and forwarding events to a debug level. In Astro this hides the logs by default. For other plaftorms falling back to the default logger, we probably need to add a debug flag or something later on

Before opening this PR:

  • I added a Changeset Entry with pnpm changeset:add
  • I referenced issues that this PR addresses

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spotlightjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2023 0:39am

Comment thread .changeset/poor-coins-sip.md Outdated
@Lms24 Lms24 merged commit 129a3d4 into main Dec 5, 2023
@Lms24 Lms24 deleted the lms/feat-sideacar-logger branch December 5, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve sidecar logging

1 participant