-
-
Notifications
You must be signed in to change notification settings - Fork 69
feat(kit): RFC - Unified Logging API proposal #155
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
Open
adriandarian
wants to merge
12
commits into
vitejs:main
Choose a base branch
from
adriandarian:feat/unified-logger-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ebe86ea
feat(kit): RFC - Unified Logging API proposal
adriandarian 0e37a4d
Merge branch 'main' into feat/unified-logger-api
adriandarian eea89f6
Merge branch 'main' into feat/unified-logger-api
adriandarian d16a01e
feat(logger): integrate consola for unified logging API and remove le…
adriandarian 4c3f508
refactor(logging): remove legacy logging examples and RFC documents i…
adriandarian 1cccaab
chore(eslint): disable 'unimport/auto-insert' rule for specific files
adriandarian 97ffa0b
chore(eslint): update file patterns for TypeScript linting
adriandarian 2517cd1
feat(turbo): add new task configurations for dev preparation and buil…
adriandarian 0b26890
Merge branch 'main' into feat/unified-logger-api
adriandarian 483614c
Merge branch 'feat/unified-logger-api' of https://github.com/adrianda…
adriandarian f5fc99f
feat(App.vue): pass context prop to DockEntriesWithCategories component
adriandarian 8ec66ef
Merge branch 'main' into feat/unified-logger-api
adriandarian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * Logger API using Consola | ||
| * | ||
| * Provides a simple logger interface using unjs/consola, similar to Nuxt Kit. | ||
| * Exposed on context.logger for use in DevTools plugins. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * export default defineDevToolsPlugin({ | ||
| * setup(context) { | ||
| * context.logger.info('Plugin initialized') | ||
| * context.logger.debug('Debug info', { config }) | ||
| * context.logger.warn('Deprecated option used') | ||
| * context.logger.error(new Error('Something went wrong')) | ||
| * | ||
| * // Create child loggers for sub-components | ||
| * const rpcLogger = context.logger.withTag('rpc') | ||
| * rpcLogger.info('RPC connected') // [rpc] RPC connected | ||
| * } | ||
| * }) | ||
| * ``` | ||
| */ | ||
|
|
||
| import { consola } from 'consola' | ||
|
|
||
| export type { ConsolaInstance as Logger } from 'consola' | ||
|
|
||
| /** | ||
| * Create a logger instance with the given tag/scope. | ||
| * Similar to Nuxt Kit's useLogger. | ||
| * | ||
| * @param tag - Tag/scope for the logger (e.g., 'my-plugin', 'rpc') | ||
| * @returns Consola logger instance | ||
| */ | ||
| export function createLogger(tag?: string): ReturnType<typeof consola.withTag> { | ||
| return tag ? consola.withTag(tag) : consola | ||
| } | ||
|
|
||
| /** | ||
| * Default logger instance. | ||
| */ | ||
| export const logger = consola |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,29 @@ | ||
| { | ||
| "$schema": "https://turbo.build/schema.json", | ||
| "tasks": { | ||
| "dev:prepare": { | ||
| "outputLogs": "new-only", | ||
| "outputs": [ | ||
| "**/.nuxt/**" | ||
| ] | ||
| }, | ||
| "build": { | ||
| "outputLogs": "new-only", | ||
| "outputs": [ | ||
| "dist/**" | ||
| ], | ||
| "dependsOn": [ | ||
| "^build" | ||
| ] | ||
| }, | ||
| "@vitejs/devtools-vite#build": { | ||
| "dependsOn": [ | ||
| "@vitejs/devtools-vite#dev:prepare" | ||
| ] | ||
| }, | ||
| "@vitejs/devtools#build": { | ||
| "dependsOn": [ | ||
| "@vitejs/devtools-vite#dev:prepare" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also appreciated for this change to be in another PR. |
||
| ] | ||
| } | ||
| } | ||
|
|
||
Oops, something went wrong.
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.
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.
I appreciated the bugfix (that I also found and fixed) - but please avoid changes like this to focus on the scope of PR.