@xylabs/logger 4.13.14 β†’ 4.13.16

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/README.md CHANGED
@@ -1,63 +1,54 @@
1
- [![logo][]](https://xylabs.com)
2
-
3
1
  # @xylabs/logger
4
2
 
3
+ [![logo][]](https://xylabs.com)
4
+
5
+ [![main-build][]][main-build-link]
5
6
  [![npm-badge][]][npm-link]
6
7
  [![npm-downloads-badge][]][npm-link]
7
8
  [![jsdelivr-badge][]][jsdelivr-link]
8
9
  [![npm-license-badge][]](LICENSE)
10
+ [![codacy-badge][]][codacy-link]
11
+ [![codeclimate-badge][]][codeclimate-link]
12
+ [![snyk-badge][]][snyk-link]
9
13
  [![socket-badge][]][socket-link]
10
14
 
11
- > XY Labs Logger Helpers
12
-
13
- ## Table of Contents
14
-
15
- - [Description](#description)
16
- - [Install](#install)
17
- - [Maintainers](#maintainers)
18
- - [License](#license)
19
- - [Credits](#credits)
20
-
21
- ## Description
15
+ Version: 4.13.15
22
16
 
23
- Various Logger helper functions
17
+ XYLabs Logger Library
24
18
 
25
- ## Install
26
-
27
- Using npm:
28
-
29
- ```sh
30
- npm i --save @xylabs/logger
31
- ```
19
+ ## Documentation
32
20
 
33
- Using yarn:
21
+ Coming Soon!
34
22
 
35
- ```sh
36
- yarn add @xylabs/logger
37
- ```
38
-
39
- ## Documentation
40
- [Developer Reference](https://xylabs.github.io/sdk-js)
23
+ Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
41
24
 
42
25
  ## Maintainers
43
26
 
44
27
  - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
45
- - [Joel Carter](https://github.com/JoelBCarter)
46
28
  - [Matt Jones](https://github.com/jonesmac)
29
+ - [Joel Carter](https://github.com/JoelBCarter)
47
30
  - [Jordan Trouw](https://github.com/jordantrouw)
48
31
 
49
32
  ## License
50
33
 
51
- See the [LICENSE](LICENSE) file for license details
34
+ > See the [LICENSE](LICENSE) file for license details
52
35
 
53
36
  ## Credits
54
37
 
55
- [Made with πŸ”₯and ❄️ by XY Labs](https://xylabs.com)
38
+ [Made with πŸ”₯ and ❄️ by XYLabs](https://xylabs.com)
56
39
 
57
40
  [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
58
41
 
42
+ [main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml/badge.svg
43
+ [main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build.yml
59
44
  [npm-badge]: https://img.shields.io/npm/v/@xylabs/logger.svg
60
45
  [npm-link]: https://www.npmjs.com/package/@xylabs/logger
46
+ [codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698
47
+ [codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade
48
+ [codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability
49
+ [codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability
50
+ [snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json
51
+ [snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json
61
52
 
62
53
  [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/logger
63
54
  [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/logger
@@ -0,0 +1,5 @@
1
+ import { LevelLogger, LogLevel } from './LevelLogger.ts';
2
+ export declare class ConsoleLogger extends LevelLogger {
3
+ constructor(level?: LogLevel);
4
+ }
5
+ //# sourceMappingURL=ConsoleLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../src/ConsoleLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAExD,qBAAa,aAAc,SAAQ,WAAW;gBAChC,KAAK,GAAE,QAAwB;CAG5C"}
@@ -0,0 +1,15 @@
1
+ import type { Logger } from './LevelLogger.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
+ trace(...data: unknown[]): void;
12
+ warn(...data: unknown[]): void;
13
+ private prefix;
14
+ }
15
+ //# sourceMappingURL=IdLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdLogger.d.ts","sourceRoot":"","sources":["../../src/IdLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,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,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIxB,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIvB,OAAO,CAAC,MAAM;CAGf"}
@@ -0,0 +1,45 @@
1
+ import type { EnumKey, EnumValue } from '@xylabs/enum';
2
+ import { Enum } from '@xylabs/enum';
3
+ export type LogFunction = (...data: unknown[]) => void;
4
+ /**
5
+ * Interface to handle overlap between Winston &
6
+ * `console` with as much congruency as possible.
7
+ */
8
+ export interface Logger {
9
+ debug: LogFunction;
10
+ error: LogFunction;
11
+ info: LogFunction;
12
+ log: LogFunction;
13
+ trace: LogFunction;
14
+ warn: LogFunction;
15
+ }
16
+ export declare const LogLevel: Enum<{
17
+ error: 1;
18
+ warn: 2;
19
+ info: 3;
20
+ log: 4;
21
+ debug: 5;
22
+ trace: 6;
23
+ }>;
24
+ export type LogLevelKey = EnumKey<typeof LogLevel>;
25
+ export type LogVerbosity = LogLevelKey;
26
+ export type LogLevelValue = EnumValue<typeof LogLevel>;
27
+ /**
28
+ * @deprecated Use `LogLevelValue` instead.
29
+ * This name conflicts with the `LogLevel` enum and
30
+ * makes it confusing to import
31
+ */
32
+ export type LogLevel = LogLevelValue;
33
+ export declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
34
+ export declare class LevelLogger implements Logger {
35
+ readonly level: LogLevelValue;
36
+ readonly logger: Logger;
37
+ constructor(logger: Logger, level?: LogLevelValue);
38
+ get debug(): LogFunction;
39
+ get error(): LogFunction;
40
+ get info(): LogFunction;
41
+ get log(): LogFunction;
42
+ get trace(): LogFunction;
43
+ get warn(): LogFunction;
44
+ }
45
+ //# sourceMappingURL=LevelLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LevelLogger.d.ts","sourceRoot":"","sources":["../../src/LevelLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,WAAW,CAAA;IAClB,IAAI,EAAE,WAAW,CAAA;IACjB,GAAG,EAAE,WAAW,CAAA;IAChB,KAAK,EAAE,WAAW,CAAA;IAClB,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,eAAO,MAAM,QAAQ;;;;;;;EAOnB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,QAAQ,CAAC,CAAA;AAClD,MAAM,MAAM,YAAY,GAAG,WAAW,CAAA;AAEtC,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,QAAQ,CAAC,CAAA;AACtD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAA;AAEpC,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,OAAO,EAAE,cAAY,CAAA;AAE/D,qBAAa,WAAY,YAAW,MAAM;IACxC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBACX,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,aAA6B;IAKhE,IAAI,KAAK,gBAER;IAED,IAAI,KAAK,gBAER;IAED,IAAI,IAAI,gBAEP;IAED,IAAI,GAAG,gBAEN;IAED,IAAI,KAAK,gBAER;IAED,IAAI,IAAI,gBAEP;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":"AAGA,eAAO,MAAM,eAAe,GAAI,cAAS,WAoBxC,CAAA"}
@@ -1,67 +1,5 @@
1
- import { EnumValue, Enum, EnumKey } 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
- type LogLevelKey = EnumKey<typeof LogLevel>;
17
- type LogVerbosity = LogLevelKey;
18
- type LogLevelValue = EnumValue<typeof LogLevel>;
19
- declare const LogLevel: Enum<{
20
- error: 1;
21
- warn: 2;
22
- info: 3;
23
- log: 4;
24
- debug: 5;
25
- trace: 6;
26
- }>;
27
- /**
28
- * @deprecated Use `LogLevelValue` instead.
29
- * This name conflicts with the `LogLevel` enum and
30
- * makes it confusing to import
31
- */
32
- type LogLevel = LogLevelValue;
33
- declare const NoOpLogFunction: (..._data: unknown[]) => undefined;
34
- declare class LevelLogger implements Logger {
35
- readonly level: LogLevelValue;
36
- readonly logger: Logger;
37
- constructor(logger: Logger, level?: LogLevelValue);
38
- get debug(): LogFunction;
39
- get error(): LogFunction;
40
- get info(): LogFunction;
41
- get log(): LogFunction;
42
- get trace(): LogFunction;
43
- get warn(): LogFunction;
44
- }
45
-
46
- declare class ConsoleLogger extends LevelLogger {
47
- constructor(level?: LogLevel);
48
- }
49
-
50
- declare const getFunctionName: (depth?: number) => string;
51
-
52
- declare class IdLogger implements Logger {
53
- private _id?;
54
- private _logger;
55
- constructor(logger: Logger, id?: () => string);
56
- set id(id: string);
57
- debug(...data: unknown[]): void;
58
- error(...data: unknown[]): void;
59
- info(...data: unknown[]): void;
60
- log(...data: unknown[]): void;
61
- trace(...data: unknown[]): void;
62
- warn(...data: unknown[]): void;
63
- private prefix;
64
- }
65
-
66
- export { ConsoleLogger, IdLogger, LevelLogger, LogLevel, NoOpLogFunction, getFunctionName };
67
- export type { LogFunction, LogLevelKey, LogLevelValue, LogVerbosity, Logger };
1
+ export * from './ConsoleLogger.ts';
2
+ export * from './getFunctionName.ts';
3
+ export * from './IdLogger.ts';
4
+ export * from './LevelLogger.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IdLogger.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdLogger.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/IdLogger.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/logger",
3
- "version": "4.13.14",
3
+ "version": "4.13.16",
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.14",
40
- "@xylabs/error": "^4.13.14",
41
- "@xylabs/typeof": "^4.13.14"
39
+ "@xylabs/enum": "^4.13.16",
40
+ "@xylabs/error": "^4.13.16",
41
+ "@xylabs/typeof": "^4.13.16"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/node": "^24.0.13",
45
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.12",
46
- "@xylabs/tsconfig": "^7.0.0-rc.12",
44
+ "@types/node": "^24.0.14",
45
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
46
+ "@xylabs/tsconfig": "^7.0.0-rc.27",
47
47
  "typescript": "^5.8.3",
48
48
  "vitest": "^3.2.4"
49
49
  },