-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[@astrojs/image] adds a logger to the the image integration #4342
Conversation
🦋 Changeset detectedLatest commit: bdafc9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
} | ||
|
||
export default function integration(options: IntegrationOptions = {}): AstroIntegration { | ||
const resolvedOptions = { | ||
serviceEntryPoint: '@astrojs/image/sharp', | ||
logLevel: 'info' as LoggerLevel, |
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.
Thanks for this @tony-sull! Nice QOL improvement.
I like allowing this to be configured at the integration level to allow debugging only images but do you think this should use a default set by the existing logging options?
Running DEBUG=* astro build
or DEBUG=vite:* astro build
is something we support via Vite, so maybe we should be tapping into that same system?
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.
Yeah I had considered that but ended up just mimicking core's logger for now. Ideally we could expose Astro's internal logger to all integrations, there's a bit of work to really get that logger ready for outside use first though
Changes
Adds a logger to the image integration with similar support to Astro's internal logger.
logLevel
can be set directly in the integrationlogLevel: "info"
(default)logLevel: "debug"
Testing
Existing tests should all pass
Docs
README updated with docs for the new integration config option