Skip to content
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

Merged
merged 10 commits into from
Aug 22, 2022

Conversation

tony-sull
Copy link
Contributor

Changes

Adds a logger to the image integration with similar support to Astro's internal logger. logLevel can be set directly in the integration

logLevel: "info" (default)

Screen Shot 2022-08-15 at 11 36 30 PM

logLevel: "debug"

Screen Shot 2022-08-15 at 11 36 44 PM

Testing

Existing tests should all pass

Docs

README updated with docs for the new integration config option

@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2022

🦋 Changeset detected

Latest commit: bdafc9a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/image Patch

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

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Aug 16, 2022
}

export default function integration(options: IntegrationOptions = {}): AstroIntegration {
const resolvedOptions = {
serviceEntryPoint: '@astrojs/image/sharp',
logLevel: 'info' as LoggerLevel,
Copy link
Member

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?

Copy link
Contributor Author

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

@tony-sull tony-sull self-assigned this Aug 22, 2022
@tony-sull tony-sull merged commit c4af872 into main Aug 22, 2022
@tony-sull tony-sull deleted the feat/image-logger branch August 22, 2022 19:13
This was referenced Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants