-
Notifications
You must be signed in to change notification settings - Fork 6
@ekino/logger v3.0 #48
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
base: master
Are you sure you want to change the base?
Conversation
|
TODO: fix github-action for release and changelog. |
|
|
||
| ## How to Contribute | ||
|
|
||
| Follow this guide to ensure a smooth contribution process. If you're planning significant work or substantial changes, please create an issue labeled "contribution enquiry" to discuss your proposal. This will help ensure that your work aligns with the project's goals. |
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.
- The label does not exist
- A new contributor cannot add labels, most of the time a member must set the labels for him
| 2. **Clone Your Fork** | ||
| Clone your forked repo to your local machine: | ||
| ```bash | ||
| git clone git@github.com:ekino/node-logger.git |
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.
| git clone git@github.com:ekino/node-logger.git | |
| git clone git@github.com:[YOUR_GITHUB_ACCOUNT]/node-logger.git |
since you forked the repository the address is not correct
| Ensure your changes are reliable by including tests. For small patches, a simple test is fine; for new features, create a dedicated test suite. | ||
|
|
||
| 7. **Coding Style and Conventions** | ||
| Maintain the project’s coding standards. Consistent indentation, comments, and style improve readability. |
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.
maybe we could invite the contributor to install official biome ext for vscode ? (or any other IDE)
https://biomejs.dev/reference/vscode/
|
|
||
| - Benchmark basic | ||
| ```bash | ||
| node ./benchmarks/basic.js |
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.
| node ./benchmarks/basic.js | |
| pnpm run build | |
| node ./benchmarks/basic.js |
| - Benchmark with complex object | ||
|
|
||
| ```bash | ||
| node ./benchmarks/complex.js |
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.
| node ./benchmarks/complex.js | |
| pnpm run build | |
| node ./benchmarks/complex.js |
| Tested on Nodejs 22.10.0 | ||
| ```bash | ||
| ┌─────────┬──────────────────────┬──────────┐ | ||
| │ (index) │ library │ ops/sec │ | ||
| ├─────────┼──────────────────────┼──────────┤ | ||
| │ 0 │ 'Pino' │ '26,506' │ | ||
| │ 1 │ '@ekino/logger v3.x' │ '21,915' │ | ||
| │ 2 │ '@ekino/logger v2.x' │ '18,826' │ | ||
| │ 3 │ 'Winston' │ '4,251' │ | ||
| └─────────┴──────────────────────┴──────────┘ | ||
| ``` No newline at end of file |
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.
| Tested on Nodejs 22.10.0 | |
| ```bash | |
| ┌─────────┬──────────────────────┬──────────┐ | |
| │ (index) │ library │ ops/sec │ | |
| ├─────────┼──────────────────────┼──────────┤ | |
| │ 0 │ 'Pino' │ '26,506' │ | |
| │ 1 │ '@ekino/logger v3.x' │ '21,915' │ | |
| │ 2 │ '@ekino/logger v2.x' │ '18,826' │ | |
| │ 3 │ 'Winston' │ '4,251' │ | |
| └─────────┴──────────────────────┴──────────┘ | |
| ``` | |
| Tested on Nodejs 24.3.0 | |
| Macbook Pro AppleM2 Pro (macos 15.7.2) | |
| ```bash | |
| ┌─────────┬──────────────────────┬──────────┐ | |
| │ (index) │ library │ ops/sec │ | |
| ├─────────┼──────────────────────┼──────────┤ | |
| │ 0 │ 'Pino' │ '42,089' │ | |
| │ 1 │ '@ekino/logger v3.x' │ '31,158' │ | |
| │ 2 │ '@ekino/logger v2.x' │ '26,871' │ | |
| │ 3 │ 'Winston' │ '2,743' │ | |
| └─────────┴──────────────────────┴──────────┘ |
|
|
||
| - **Dual ESM and CommonJS**: Added support for both module formats. No syntax changes needed from 2.x. | ||
| - **Functional style**: Refactored to use a fully functional API, removing internal objects. Update code that accessed internals directly. | ||
| - **Node.js update**: Dropped support for Node 14 and 16. Now compatible with Node 18, 20, 22, and above. |
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.
| - **Node.js update**: Dropped support for Node 14 and 16. Now compatible with Node 18, 20, 22, and above. | |
| - **Node.js update**: Dropped support for Node 16, and 18. Now compatible with Node 20, 22, 24, and above. |
|
|
||
| logger.setNamespaces('namespace:*') | ||
| logger.setLevel('debug') | ||
| //logger.setOutput(logger.outputs.json) |
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.
| //logger.setOutput(logger.outputs.json) |
|
|
||
| logger.setNamespaces('namespace:*') | ||
| logger.setLevel('debug') | ||
| //logger.setOutput(logger.outputs.json) |
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.
| //logger.setOutput(logger.outputs.json) |
|
|
||
| logger.setNamespaces('namespace:*') | ||
| logger.setLevel('debug') | ||
| //logger.setOutput(logger.outputs.json) |
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.
| //logger.setOutput(logger.outputs.json) |
Summary
Rewrite @ekino/logger for v3.0
Motivation
What has changed?
Here are the key changes made in this PR:
Test plan