@xylabs/logger 4.13.3 → 4.13.5
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/neutral/index.d.ts +59 -64
- package/package.json +6 -6
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,64 +1,59 @@
|
|
|
1
|
-
import { Enum } from '@xylabs/enum';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
get
|
|
31
|
-
get
|
|
32
|
-
get
|
|
33
|
-
get
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export declare type LogLevel = EnumValue<typeof LogLevel>;
|
|
61
|
-
|
|
62
|
-
export declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
|
|
63
|
-
|
|
64
|
-
export { }
|
|
1
|
+
import { Enum, EnumValue } from '@xylabs/enum';
|
|
2
|
+
|
|
3
|
+
type LogFunction = (...data: unknown[]) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Interface to handle overlap between Winston &
|
|
6
|
+
* `console` with as much congruency as possible.
|
|
7
|
+
*/
|
|
8
|
+
interface Logger {
|
|
9
|
+
debug: LogFunction;
|
|
10
|
+
error: LogFunction;
|
|
11
|
+
info: LogFunction;
|
|
12
|
+
log: LogFunction;
|
|
13
|
+
trace: LogFunction;
|
|
14
|
+
warn: LogFunction;
|
|
15
|
+
}
|
|
16
|
+
declare const LogLevel: Enum<{
|
|
17
|
+
error: 1;
|
|
18
|
+
warn: 2;
|
|
19
|
+
info: 3;
|
|
20
|
+
log: 4;
|
|
21
|
+
debug: 5;
|
|
22
|
+
trace: 6;
|
|
23
|
+
}>;
|
|
24
|
+
type LogLevel = EnumValue<typeof LogLevel>;
|
|
25
|
+
declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
|
|
26
|
+
declare class LevelLogger implements Logger {
|
|
27
|
+
readonly level: LogLevel;
|
|
28
|
+
readonly logger: Logger;
|
|
29
|
+
constructor(logger: Logger, level?: LogLevel);
|
|
30
|
+
get debug(): LogFunction;
|
|
31
|
+
get error(): LogFunction;
|
|
32
|
+
get info(): LogFunction;
|
|
33
|
+
get log(): LogFunction;
|
|
34
|
+
get trace(): LogFunction;
|
|
35
|
+
get warn(): LogFunction;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class ConsoleLogger extends LevelLogger {
|
|
39
|
+
constructor(level?: LogLevel);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare const getFunctionName: (depth?: number) => string;
|
|
43
|
+
|
|
44
|
+
declare class IdLogger implements Logger {
|
|
45
|
+
private _id?;
|
|
46
|
+
private _logger;
|
|
47
|
+
constructor(logger: Logger, id?: () => string);
|
|
48
|
+
set id(id: string);
|
|
49
|
+
debug(...data: unknown[]): void;
|
|
50
|
+
error(...data: unknown[]): void;
|
|
51
|
+
info(...data: unknown[]): void;
|
|
52
|
+
log(...data: unknown[]): void;
|
|
53
|
+
trace(...data: unknown[]): void;
|
|
54
|
+
warn(...data: unknown[]): void;
|
|
55
|
+
private prefix;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { ConsoleLogger, IdLogger, LevelLogger, LogLevel, NoOpLogFunction, getFunctionName };
|
|
59
|
+
export type { LogFunction, Logger };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/logger",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.5",
|
|
4
4
|
"description": "XYLabs Logger Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"logger",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"module": "dist/neutral/index.mjs",
|
|
37
37
|
"types": "dist/neutral/index.d.ts",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xylabs/enum": "^4.13.
|
|
40
|
-
"@xylabs/error": "^4.13.
|
|
41
|
-
"@xylabs/typeof": "^4.13.
|
|
39
|
+
"@xylabs/enum": "^4.13.5",
|
|
40
|
+
"@xylabs/error": "^4.13.5",
|
|
41
|
+
"@xylabs/typeof": "^4.13.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^24.0.13",
|
|
45
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.
|
|
46
|
-
"@xylabs/tsconfig": "^7.0.0-rc.
|
|
45
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.8",
|
|
46
|
+
"@xylabs/tsconfig": "^7.0.0-rc.8",
|
|
47
47
|
"typescript": "^5.8.3",
|
|
48
48
|
"vitest": "^3.2.4"
|
|
49
49
|
},
|