@jay-framework/logger 0.12.0 → 0.14.0
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/dist/index.d.mts +4 -4
- package/dist/index.mjs +8 -8
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -16,13 +16,13 @@ type LogLevel = 'silent' | 'info' | 'verbose';
|
|
|
16
16
|
*/
|
|
17
17
|
interface JayLogger {
|
|
18
18
|
/** Log important messages - shown in default mode (startup, major events) */
|
|
19
|
-
important: (msg: string) => void;
|
|
19
|
+
important: (msg: string, ...args: unknown[]) => void;
|
|
20
20
|
/** Log info messages - shown only in verbose mode */
|
|
21
|
-
info: (msg: string) => void;
|
|
21
|
+
info: (msg: string, ...args: unknown[]) => void;
|
|
22
22
|
/** Log warnings - shown unless silent */
|
|
23
|
-
warn: (msg: string) => void;
|
|
23
|
+
warn: (msg: string, ...args: unknown[]) => void;
|
|
24
24
|
/** Log errors - always shown */
|
|
25
|
-
error: (msg: string) => void;
|
|
25
|
+
error: (msg: string, ...args: unknown[]) => void;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Request timing interface for dev server performance tracking.
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const defaultLogger = {
|
|
2
|
-
important: (msg) => console.log(msg),
|
|
3
|
-
info: (msg) => console.log(msg),
|
|
4
|
-
warn: (msg) => console.warn(msg),
|
|
5
|
-
error: (msg) => console.error(msg)
|
|
2
|
+
important: (msg, ...args) => console.log(msg, ...args),
|
|
3
|
+
info: (msg, ...args) => console.log(msg, ...args),
|
|
4
|
+
warn: (msg, ...args) => console.warn(msg, ...args),
|
|
5
|
+
error: (msg, ...args) => console.error(msg, ...args)
|
|
6
6
|
};
|
|
7
7
|
let currentLogger = defaultLogger;
|
|
8
8
|
function getLogger() {
|
|
@@ -19,12 +19,12 @@ function createLogger(level) {
|
|
|
19
19
|
const isVerbose = level === "verbose";
|
|
20
20
|
return {
|
|
21
21
|
important: isSilent ? () => {
|
|
22
|
-
} : (msg) => console.log(msg),
|
|
23
|
-
info: isVerbose ? (msg) => console.log(msg) : () => {
|
|
22
|
+
} : (msg, ...args) => console.log(msg, ...args),
|
|
23
|
+
info: isVerbose ? (msg, ...args) => console.log(msg, ...args) : () => {
|
|
24
24
|
},
|
|
25
25
|
warn: isSilent ? () => {
|
|
26
|
-
} : (msg) => console.warn(msg),
|
|
27
|
-
error: (msg) => console.error(msg)
|
|
26
|
+
} : (msg, ...args) => console.warn(msg, ...args),
|
|
27
|
+
error: (msg, ...args) => console.error(msg, ...args)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
let currentDevLogger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/logger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test:watch": "vitest"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@jay-framework/dev-environment": "^0.
|
|
22
|
+
"@jay-framework/dev-environment": "^0.14.0",
|
|
23
23
|
"@types/node": "^20.11.5",
|
|
24
24
|
"rimraf": "^5.0.5",
|
|
25
25
|
"tsup": "^8.0.1",
|