@xylabs/logger 4.0.3 → 4.0.4

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.
@@ -0,0 +1,14 @@
1
+ import type { Logger } from './Logger.ts';
2
+ export declare class IdLogger implements Logger {
3
+ private _id?;
4
+ private _logger;
5
+ constructor(logger: Logger, id?: () => string);
6
+ set id(id: string);
7
+ debug(...data: unknown[]): void;
8
+ error(...data: unknown[]): void;
9
+ info(...data: unknown[]): void;
10
+ log(...data: unknown[]): void;
11
+ warn(...data: unknown[]): void;
12
+ private prefix;
13
+ }
14
+ //# sourceMappingURL=IdLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdLogger.d.ts","sourceRoot":"","sources":["../../src/IdLogger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,qBAAa,QAAS,YAAW,MAAM;IACrC,OAAO,CAAC,GAAG,CAAC,CAAc;IAC1B,OAAO,CAAC,OAAO,CAAQ;gBAEX,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,MAAM;IAK7C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAEhB;IAED,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIxB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIxB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIvB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAItB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIvB,OAAO,CAAC,MAAM;CAGf"}
@@ -0,0 +1,26 @@
1
+ export type LogFunction = (...data: unknown[]) => void;
2
+ export interface Logger {
3
+ debug: LogFunction;
4
+ error: LogFunction;
5
+ info: LogFunction;
6
+ log: LogFunction;
7
+ warn: LogFunction;
8
+ }
9
+ export declare enum LogLevel {
10
+ error = 1,
11
+ warn = 2,
12
+ info = 3,
13
+ log = 4,
14
+ debug = 5
15
+ }
16
+ export declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
17
+ export declare class ConsoleLogger implements Logger {
18
+ readonly level: LogLevel;
19
+ constructor(level?: LogLevel);
20
+ get debug(): (message?: any, ...optionalParams: any[]) => void;
21
+ get error(): (message?: any, ...optionalParams: any[]) => void;
22
+ get info(): (message?: any, ...optionalParams: any[]) => void;
23
+ get log(): (message?: any, ...optionalParams: any[]) => void;
24
+ get warn(): (message?: any, ...optionalParams: any[]) => void;
25
+ }
26
+ //# sourceMappingURL=Logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/Logger.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;AAMtD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,WAAW,CAAA;IAClB,IAAI,EAAE,WAAW,CAAA;IACjB,GAAG,EAAE,WAAW,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,IAAI,IAAI;IACR,GAAG,IAAI;IACP,KAAK,IAAI;CACV;AAED,eAAO,MAAM,eAAe,aAAc,OAAO,EAAE,cAAY,CAAA;AAE/D,qBAAa,aAAc,YAAW,MAAM;IAC9B,QAAQ,CAAC,KAAK,EAAE,QAAQ;gBAAf,KAAK,GAAE,QAAwB;IAEpD,IAAI,KAAK,sDAER;IAED,IAAI,KAAK,sDAER;IAED,IAAI,IAAI,sDAEP;IAED,IAAI,GAAG,sDAEN;IAED,IAAI,IAAI,sDAEP;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare const getFunctionName: (depth?: number) => string;
2
+ //# sourceMappingURL=getFunctionName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFunctionName.d.ts","sourceRoot":"","sources":["../../src/getFunctionName.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,4BAoB3B,CAAA"}
@@ -1,42 +1,4 @@
1
- declare const getFunctionName: (depth?: number) => string;
2
-
3
- type LogFunction = (...data: unknown[]) => void;
4
- interface Logger {
5
- debug: LogFunction;
6
- error: LogFunction;
7
- info: LogFunction;
8
- log: LogFunction;
9
- warn: LogFunction;
10
- }
11
- declare enum LogLevel {
12
- error = 1,
13
- warn = 2,
14
- info = 3,
15
- log = 4,
16
- debug = 5
17
- }
18
- declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
19
- declare class ConsoleLogger implements Logger {
20
- readonly level: LogLevel;
21
- constructor(level?: LogLevel);
22
- get debug(): (message?: any, ...optionalParams: any[]) => void;
23
- get error(): (message?: any, ...optionalParams: any[]) => void;
24
- get info(): (message?: any, ...optionalParams: any[]) => void;
25
- get log(): (message?: any, ...optionalParams: any[]) => void;
26
- get warn(): (message?: any, ...optionalParams: any[]) => void;
27
- }
28
-
29
- declare class IdLogger implements Logger {
30
- private _id?;
31
- private _logger;
32
- constructor(logger: Logger, id?: () => string);
33
- set id(id: string);
34
- debug(...data: unknown[]): void;
35
- error(...data: unknown[]): void;
36
- info(...data: unknown[]): void;
37
- log(...data: unknown[]): void;
38
- warn(...data: unknown[]): void;
39
- private prefix;
40
- }
41
-
42
- export { ConsoleLogger, IdLogger, type LogFunction, LogLevel, type Logger, NoOpLogFunction, getFunctionName };
1
+ export * from './getFunctionName.ts';
2
+ export * from './IdLogger.ts';
3
+ export * from './Logger.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/logger",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "keywords": [
6
6
  "log",
@@ -38,11 +38,11 @@
38
38
  "module": "dist/neutral/index.mjs",
39
39
  "types": "dist/neutral/index.d.ts",
40
40
  "dependencies": {
41
- "@xylabs/error": "^4.0.3"
41
+ "@xylabs/error": "^4.0.4"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/ts-scripts-yarn3": "^4.0.0",
45
- "@xylabs/tsconfig": "^4.0.0",
44
+ "@xylabs/ts-scripts-yarn3": "^4.0.7",
45
+ "@xylabs/tsconfig": "^4.0.7",
46
46
  "typescript": "^5.5.4"
47
47
  },
48
48
  "engines": {