@wnodex/logger 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/README.md +40 -5
- package/package.json +9 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
> @wnodex/logger@0.2.
|
|
2
|
+
> @wnodex/logger@0.2.2 build /home/runner/work/wnodex/wnodex/packages/logger
|
|
3
3
|
> rolldown -c && tsc
|
|
4
4
|
|
|
5
5
|
[log] <DIR>/index.js chunk │ size: 0.52 kB
|
|
6
6
|
[log]
|
|
7
|
-
[success] rolldown v1.0.0-rc.1 Finished in
|
|
7
|
+
[success] rolldown v1.0.0-rc.1 Finished in 13.69 ms
|
package/README.md
CHANGED
|
@@ -1,14 +1,49 @@
|
|
|
1
1
|
# @wnodex/logger
|
|
2
2
|
|
|
3
|
-
wnodex logger
|
|
3
|
+
> wnodex logger
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Part of the [wnodex](https://github.com/wnodex/wnodex) ecosystem, this package provides a pre-configured logger for `wnodex` applications.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## About
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
`@wnodex/logger` provides a singleton logger instance powered by `pino`, a fast and low-overhead logger. It is configured to output pretty, human-readable logs during development and efficient JSON logs in production.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- High-performance logging with `pino`.
|
|
14
|
+
- **Pretty printing**: Colorized, single-line logs in development via `pino-pretty`.
|
|
15
|
+
- **JSON logs**: Structured, machine-readable logs in production.
|
|
16
|
+
- Automatically integrated into the `wnodex` application instance.
|
|
17
|
+
|
|
18
|
+
## Why use it?
|
|
19
|
+
|
|
20
|
+
Consistent and structured logging is essential for monitoring and debugging applications. `@wnodex/logger` provides a production-ready logging setup out of the box, with zero configuration required. The logger instance is automatically available throughout your `wnodex` application.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
This package is a core dependency of `wnodex` and does not need to be installed separately.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
The logger is automatically initialized and attached to the `wnodex` instance. You can access it via the `getLogger()` method or from the Express `app` object.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { Wnodex } from 'wnodex';
|
|
32
|
+
|
|
33
|
+
const server = new Wnodex({ port: 3000 });
|
|
34
|
+
const logger = server.getLogger();
|
|
35
|
+
const app = server.getApp();
|
|
36
|
+
|
|
37
|
+
logger.info('Server is starting...');
|
|
38
|
+
|
|
39
|
+
app.get('/', (req, res) => {
|
|
40
|
+
const appLogger = req.app.get('logger');
|
|
41
|
+
appLogger.info('Received a request on /');
|
|
42
|
+
res.send('Hello World!');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
server.start();
|
|
46
|
+
```
|
|
12
47
|
|
|
13
48
|
## License
|
|
14
49
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wnodex/logger",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "wnodex
|
|
5
|
+
"description": "A pre-configured Pino logger for wnodex applications with pretty-printing for development.",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"wnodex"
|
|
7
|
+
"wnodex",
|
|
8
|
+
"logger",
|
|
9
|
+
"pino",
|
|
10
|
+
"pino-pretty",
|
|
11
|
+
"logging",
|
|
12
|
+
"json-logger"
|
|
8
13
|
],
|
|
9
14
|
"homepage": "https://github.com/wnodex/wnodex#readme",
|
|
10
15
|
"bugs": {
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
"@types/node": "^25.0.10",
|
|
37
42
|
"rolldown": "1.0.0-rc.1",
|
|
38
43
|
"typescript": "5.9.2",
|
|
39
|
-
"@wnodex/typescript-config": "0.2.
|
|
44
|
+
"@wnodex/typescript-config": "0.2.2"
|
|
40
45
|
},
|
|
41
46
|
"publishConfig": {
|
|
42
47
|
"access": "public"
|