feat: expose Logger interface for defineApi (rename hooks → logger)#332
Open
mismosmi wants to merge 6 commits into
Open
feat: expose Logger interface for defineApi (rename hooks → logger)#332mismosmi wants to merge 6 commits into
mismosmi wants to merge 6 commits into
Conversation
- Add shared Logger interface (error-only) in packages/1-tapi/src/shared/logger.ts - defineApi now accepts logger option, stored on ApiDefinition - createRequestHandler: rename hooks -> logger, falls back to api.logger then console.error - createFetchClient and client Cache: rename hooks -> logger - handleTapiRequest (worker): accept logger option - Bunny (create-bunny-app, dev): use api.logger if set, otherwise default console.error - vite-plugin-tapi: rename hooks -> logger - Export Logger type from server and client index files Closes #329 Co-authored-by: Michel Smola <mismosmi@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 7559307 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
Logger is now sourced exclusively from the api definition. Bunny sets a default logger on the api when one isn't provided by the user.
Mirrors the Bunny pattern: assign the logger onto api.logger before calling createRequestHandler now that the option no longer exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose a server-side logger for use customization with vite-tapi.
Loggerinterface (error-only)defineApiacceptslogger?: Logger, stored onApiDefinitionhooks→loggeracross server, client, workerapi.loggerwhen set, otherwise defaults toconsole.errorLoggertype exported from server and client index filesCloses #329
Generated with Claude Code