@alwatr/logger 0.11.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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.11.0](https://github.com/AliMD/alwatr/compare/v0.10.1...v0.11.0) (2022-04-16)
6
+ # [0.14.0](https://github.com/AliMD/alwatr/compare/v0.13.0...v0.14.0) (2022-08-19)
7
7
 
8
8
  **Note:** Version bump only for package @alwatr/logger
9
9
 
@@ -11,77 +11,70 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [0.10.0](https://github.com/AliMD/alwatr/compare/v0.9.0...v0.10.0) (2022-04-02)
14
+ # [0.13.0](https://github.com/AliMD/alwatr/compare/v0.12.0...v0.13.0) (2022-08-06)
15
15
 
16
16
  **Note:** Version bump only for package @alwatr/logger
17
17
 
18
+ # [0.12.0](https://github.com/AliMD/alwatr/compare/v0.11.0...v0.12.0) (2022-07-22)
19
+
20
+ ### Bug Fixes
18
21
 
22
+ - **logger:** refactor behavior of force ([7d9307b](https://github.com/AliMD/alwatr/commit/7d9307bb78523f3dae17b3bd80fa2fb47c90975f))
19
23
 
24
+ ### Features
20
25
 
26
+ - **logger:** compatible with node.js ([7ee8b6d](https://github.com/AliMD/alwatr/commit/7ee8b6de3143e39c300345dec6864c9c56a4aae7))
27
+ - **logger:** node coloring support ([2b4aab6](https://github.com/AliMD/alwatr/commit/2b4aab655bc0707761587a7439de98bbd4ad0e08))
21
28
 
22
- # [0.9.0](https://github.com/AliMD/alwatr/compare/v0.8.0...v0.9.0) (2022-03-22)
29
+ # [0.11.0](https://github.com/AliMD/alwatr/compare/v0.10.1...v0.11.0) (2022-04-16)
23
30
 
24
31
  **Note:** Version bump only for package @alwatr/logger
25
32
 
33
+ # [0.10.0](https://github.com/AliMD/alwatr/compare/v0.9.0...v0.10.0) (2022-04-02)
26
34
 
35
+ **Note:** Version bump only for package @alwatr/logger
27
36
 
37
+ # [0.9.0](https://github.com/AliMD/alwatr/compare/v0.8.0...v0.9.0) (2022-03-22)
28
38
 
39
+ **Note:** Version bump only for package @alwatr/logger
29
40
 
30
41
  # [0.8.0](https://github.com/AliMD/alwatr/compare/v0.7.2...v0.8.0) (2022-03-14)
31
42
 
32
43
  **Note:** Version bump only for package @alwatr/logger
33
44
 
34
-
35
-
36
-
37
-
38
45
  ## [0.7.2](https://github.com/AliMD/alwatr/compare/v0.7.1...v0.7.2) (2022-03-12)
39
46
 
40
-
41
47
  ### Features
42
48
 
43
- * **logger:** add debug and improve documents ([8f83d29](https://github.com/AliMD/alwatr/commit/8f83d2956e521f016fe530322f657c343f1a0b80))
44
-
45
-
46
-
47
-
49
+ - **logger:** add debug and improve documents ([8f83d29](https://github.com/AliMD/alwatr/commit/8f83d2956e521f016fe530322f657c343f1a0b80))
48
50
 
49
51
  # [0.7.0](https://github.com/AliMD/alwatr/compare/v0.6.1...v0.7.0) (2022-03-12)
50
52
 
51
53
  **Note:** Version bump only for package @alwatr/logger
52
54
 
53
-
54
-
55
-
56
-
57
55
  # [0.6.0](https://github.com/AliMD/alwatr/compare/v0.5.0...v0.6.0) (2022-03-11)
58
56
 
59
-
60
57
  ### Bug Fixes
61
58
 
62
- * alalwatr ([898aa6e](https://github.com/AliMD/alwatr/commit/898aa6ed0888eab9265c83b96a50f1b8c216d143))
63
- * **packages:** duplicate alwatr keyword ([77d4aa2](https://github.com/AliMD/alwatr/commit/77d4aa2105ad47515c3eee251fd6b8c281d0d1fc))
64
-
65
-
66
-
67
-
59
+ - alalwatr ([898aa6e](https://github.com/AliMD/alwatr/commit/898aa6ed0888eab9265c83b96a50f1b8c216d143))
60
+ - **packages:** duplicate alwatr keyword ([77d4aa2](https://github.com/AliMD/alwatr/commit/77d4aa2105ad47515c3eee251fd6b8c281d0d1fc))
68
61
 
69
62
  # [0.5.0](https://github.com/AliMD/alwatr/compare/v0.4.0...v0.5.0) (2022-03-11)
70
63
 
71
64
  ### Performance Improvements
72
65
 
73
- * **logger:** refactor making logger object ([bc38018](https://github.com/AliMD/alwatr/commit/bc38018758540130df2f46c44521aea0a867bbe8))
66
+ - **logger:** refactor making logger object ([bc38018](https://github.com/AliMD/alwatr/commit/bc38018758540130df2f46c44521aea0a867bbe8))
74
67
 
75
68
  # [0.4.0](https://github.com/AliMD/alwatr/compare/v0.3.0...v0.4.0) (2022-03-11)
76
69
 
77
70
  ### Bug Fixes
78
71
 
79
- * **logger:** types missing ([712363d](https://github.com/AliMD/alwatr/commit/712363d3cf77a712f8c801c4dc9d06d256dfc0e6))
72
+ - **logger:** types missing ([712363d](https://github.com/AliMD/alwatr/commit/712363d3cf77a712f8c801c4dc9d06d256dfc0e6))
80
73
 
81
74
  ### Features
82
75
 
83
- * **logger:** add logProperty, logMethodFull ([8b0317d](https://github.com/AliMD/alwatr/commit/8b0317db88ed73604a27935a3a30cd5c31cb0804))
84
- * **logger:** complete refactor the logger with new API and fix show correct line number ([7efe8cf](https://github.com/AliMD/alwatr/commit/7efe8cf0f566e148406f38fdd60fa3d747c9bc51))
76
+ - **logger:** add logProperty, logMethodFull ([8b0317d](https://github.com/AliMD/alwatr/commit/8b0317db88ed73604a27935a3a30cd5c31cb0804))
77
+ - **logger:** complete refactor the logger with new API and fix show correct line number ([7efe8cf](https://github.com/AliMD/alwatr/commit/7efe8cf0f566e148406f38fdd60fa3d747c9bc51))
85
78
 
86
79
  # [0.3.0](https://github.com/AliMD/alwatr/compare/v0.2.1...v0.3.0) (2022-03-06)
87
80
 
@@ -91,7 +84,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
91
84
 
92
85
  ### Bug Fixes
93
86
 
94
- * **logger:** alwatrRegisteredList name ([ff59133](https://github.com/AliMD/alwatr/commit/ff5913321c4eafa1ce53fdacebf8fb4f23bfe430))
87
+ - **logger:** alwatrRegisteredList name ([ff59133](https://github.com/AliMD/alwatr/commit/ff5913321c4eafa1ce53fdacebf8fb4f23bfe430))
95
88
 
96
89
  # [0.2.0](https://github.com/AliMD/alwatr/compare/v0.1.2...v0.2.0) (2022-03-05)
97
90
 
@@ -105,19 +98,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
105
98
 
106
99
  ### Bug Fixes
107
100
 
108
- * **packages:** add publish config to public ([9cb3710](https://github.com/AliMD/alwatr/commit/9cb37106b5a35d24d5195ff54232e5769ccc034e))
101
+ - **packages:** add publish config to public ([9cb3710](https://github.com/AliMD/alwatr/commit/9cb37106b5a35d24d5195ff54232e5769ccc034e))
109
102
 
110
103
  # 0.1.0 (2022-03-02)
111
104
 
112
105
  ### Bug Fixes
113
106
 
114
- * **logger:** fix debug scope ([be62f14](https://github.com/AliMD/alwatr/commit/be62f142cbe3fe4d328e3fd9941ea7c2d640a23f))
115
- * **logger:** fix logger debug scope ([e734d21](https://github.com/AliMD/alwatr/commit/e734d218db888ecec33a03dc805b98dd75543efd))
116
- * tsconfig issues ([159adeb](https://github.com/AliMD/alwatr/commit/159adeb72de4626dc16f6657765605b0a2ddccb1))
107
+ - **logger:** fix debug scope ([be62f14](https://github.com/AliMD/alwatr/commit/be62f142cbe3fe4d328e3fd9941ea7c2d640a23f))
108
+ - **logger:** fix logger debug scope ([e734d21](https://github.com/AliMD/alwatr/commit/e734d218db888ecec33a03dc805b98dd75543efd))
109
+ - tsconfig issues ([159adeb](https://github.com/AliMD/alwatr/commit/159adeb72de4626dc16f6657765605b0a2ddccb1))
117
110
 
118
111
  ### Features
119
112
 
120
- * **logger:** debug scope ([6e4190d](https://github.com/AliMD/alwatr/commit/6e4190dc9dafc28e3a7a481aa43622a23527993c))
121
- * **logger:** debug scope logger package ([1a4baeb](https://github.com/AliMD/alwatr/commit/1a4baeb7a253ba66563dbcf06079242dabb9f246))
122
- * **logger:** alwatr logger package ([711268e](https://github.com/AliMD/alwatr/commit/711268e17dea8ada9c901ef1e9d605b3212abd97))
123
- * **logger:** alwatr meta structure ([feade73](https://github.com/AliMD/alwatr/commit/feade735a6f141db77b81d7791d8872d45c8bf7e))
113
+ - **logger:** debug scope ([6e4190d](https://github.com/AliMD/alwatr/commit/6e4190dc9dafc28e3a7a481aa43622a23527993c))
114
+ - **logger:** debug scope logger package ([1a4baeb](https://github.com/AliMD/alwatr/commit/1a4baeb7a253ba66563dbcf06079242dabb9f246))
115
+ - **logger:** alwatr logger package ([711268e](https://github.com/AliMD/alwatr/commit/711268e17dea8ada9c901ef1e9d605b3212abd97))
116
+ - **logger:** alwatr meta structure ([feade73](https://github.com/AliMD/alwatr/commit/feade735a6f141db77b81d7791d8872d45c8bf7e))
package/README.md CHANGED
@@ -5,46 +5,46 @@ Fancy colorful console debugger with custom scope written in tiny TypeScript, ES
5
5
  ## Example usage
6
6
 
7
7
  ```ts
8
- import { createLogger } from 'https://esm.run/@alwatr/logger';
8
+ import {createLogger} from 'https://esm.run/@alwatr/logger';
9
9
 
10
10
  const logger = createLogger('demo');
11
11
 
12
- function sayHello (name: string) {
12
+ function sayHello(name: string) {
13
13
  logger.logMethodArgs('sayHello', {name});
14
14
  }
15
15
  ```
16
16
 
17
17
  ### Debug Mode
18
18
 
19
- Many of the methods in the logger are no-ops when the debug mode is off.
19
+ Many of the methods in the logger are no-ops when the debug mode is off.
20
20
  Please remember to **reload** the window after changing the debug mode.
21
21
 
22
22
  - Debugging all scopes
23
23
 
24
24
  ```ts
25
- window.localStorage?.setItem('ALWATR_LOG', '*');
25
+ window.localStorage?.setItem('ALWATR_DEBUG', '*');
26
26
  ```
27
27
 
28
28
  - Debugging specific scope
29
29
 
30
30
  ```ts
31
- window.localStorage?.setItem('ALWATR_LOG', 'scope_name');
31
+ window.localStorage?.setItem('ALWATR_DEBUG', 'scope_name');
32
32
  ```
33
33
 
34
34
  - Debugging some scopes with pattern
35
35
 
36
36
  ```ts
37
- window.localStorage?.setItem('ALWATR_LOG', '*alwatr*');
37
+ window.localStorage?.setItem('ALWATR_DEBUG', '*alwatr*');
38
38
  ```
39
39
 
40
- ### API
40
+ ## API
41
41
 
42
42
  ### `createLogger(scope: string, color: string, force = boolean)`
43
43
 
44
44
  Create a logger function for fancy console debug with custom scope.
45
45
 
46
46
  - **color** is optional and automatically select from internal fancy color list.
47
- - **force** is optional and default to false.
47
+ - **debug** is optional and automatically detect from localStorage `ALWATR_DEBUG` item or `process.env.ALWATR_DEBUG`
48
48
 
49
49
  Example:
50
50
 
@@ -55,15 +55,15 @@ const logger = createLogger('logger/demo');
55
55
 
56
56
  ### `logger.debug: boolean`
57
57
 
58
- Debug state for current scope base on localStorage `ALWATR_LOG` pattern.
58
+ Debug state for current scope base on localStorage `ALWATR_DEBUG` pattern.
59
59
 
60
60
  ### `logger.color: string`
61
61
 
62
- Debug state for current scope base on localStorage `ALWATR_LOG` pattern.
62
+ Debug state for current scope base on localStorage `ALWATR_DEBUG` pattern.
63
63
 
64
64
  ### `logger.scope: string`
65
65
 
66
- Debug state for current scope base on localStorage `ALWATR_LOG` pattern.
66
+ Debug state for current scope base on localStorage `ALWATR_DEBUG` pattern.
67
67
 
68
68
  ### `logger.logProperty(property, value)`
69
69
 
@@ -82,7 +82,7 @@ logger.logProperty('name', 'ali');
82
82
  Example:
83
83
 
84
84
  ```ts
85
- function myMethod () {
85
+ function myMethod() {
86
86
  logger.logMethod('myMethod');
87
87
  }
88
88
  ```
@@ -94,7 +94,7 @@ function myMethod () {
94
94
  Example:
95
95
 
96
96
  ```ts
97
- function myMethod (a: number, b: number) {
97
+ function myMethod(a: number, b: number) {
98
98
  logger.logMethodArgs('myMethod', {a, b});
99
99
  }
100
100
  ```
@@ -106,7 +106,7 @@ function myMethod (a: number, b: number) {
106
106
  Example:
107
107
 
108
108
  ```ts
109
- function add (a: number, b: number): number {
109
+ function add(a: number, b: number): number {
110
110
  const result = a + b;
111
111
  logger.logMethodFull('add', {a, b}, result);
112
112
  return result;
@@ -130,7 +130,9 @@ logger.incident('fetch', 'abort_signal', 'aborted signal received', {url: '/test
130
130
  Example:
131
131
 
132
132
  ```ts
133
- logger.accident('fetch', 'file_not_found', 'url requested return 404 not found', {url: '/test.json'});
133
+ logger.accident('fetch', 'file_not_found', 'url requested return 404 not found', {
134
+ url: '/test.json',
135
+ });
134
136
  ```
135
137
 
136
138
  ### `logger.error(method, code, errorStack, ...args)`
@@ -170,15 +172,20 @@ Best practices to catch the error and log it:
170
172
 
171
173
  ```ts
172
174
  // Unhandled promise rejection (just log it)
173
- failPromiseTest()
174
- .catch((err) => logger.error('myMethod', (err as Error).message || 'error_code', (err as Error).stack || err));
175
+ failPromiseTest().catch((err) =>
176
+ logger.error('myMethod', (err as Error).message || 'error_code', (err as Error).stack || err)
177
+ );
175
178
 
176
179
  // Handled promise rejection
177
180
  try {
178
181
  await failPromiseTest();
179
182
  } catch (err) {
180
- logger.accident('myMethod', 'error_code', 'failPromiseTest failed!, ' + (err as Error).message,
181
- (err as Error).stack || err);
183
+ logger.accident(
184
+ 'myMethod',
185
+ 'error_code',
186
+ 'failPromiseTest failed!, ' + (err as Error).message,
187
+ (err as Error).stack || err
188
+ );
182
189
  // do something to handle the error...
183
190
  }
184
191
  ```
package/logger.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import type { Logger } from './type';
1
+ import type { AlwatrLogger } from './type';
2
+ export { AlwatrLogger };
2
3
  /**
3
- * Define `window.Alwatr.registeredList`
4
+ * Define `globalThis.Alwatr.registeredList`
4
5
  */
5
6
  export declare const alwatrRegisteredList: {
6
7
  name: string;
@@ -14,7 +15,7 @@ export declare const style: {
14
15
  * Create a logger function for fancy console debug with custom scope.
15
16
  *
16
17
  * - **color** is optional and automatically select from internal fancy color list.
17
- * - **force** is optional and default to false.
18
+ * - **debug** is optional and automatically detect from localStorage `ALWATR_DEBUG` item or `process.env.ALWATR_DEBUG`
18
19
  *
19
20
  * Example:
20
21
  *
@@ -23,5 +24,5 @@ export declare const style: {
23
24
  * const logger = createLogger('logger/demo');
24
25
  * ```
25
26
  */
26
- export declare const createLogger: (scope: string, color?: string, force?: boolean) => Logger;
27
+ export declare const createLogger: (scope: string, color?: string, debug?: boolean) => AlwatrLogger;
27
28
  //# sourceMappingURL=logger.d.ts.map
package/logger.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;GAAsC,CAAC;AAoExE,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,UACd,MAAM,UACN,MAAM,sBAEd,MAuGF,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,CAAC;AAItB;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;GAA0C,CAAC;AA8E5E,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,UACd,MAAM,UACN,MAAM,sBAEd,YA6DF,CAAC"}
package/logger.js CHANGED
@@ -1,10 +1,9 @@
1
- var _a, _b, _c, _d;
1
+ const isBrowser = typeof process === 'undefined';
2
2
  /**
3
- * Define `window.Alwatr.registeredList`
3
+ * Define `globalThis.Alwatr.registeredList`
4
4
  */
5
- export const alwatrRegisteredList = ((_a = window.Alwatr) === null || _a === void 0 ? void 0 : _a.registeredList) || [];
6
- (_b = window.Alwatr) !== null && _b !== void 0 ? _b : (window.Alwatr = {});
7
- window.Alwatr.registeredList = alwatrRegisteredList;
5
+ export const alwatrRegisteredList = globalThis.Alwatr?.registeredList || [];
6
+ globalThis.Alwatr ?? (globalThis.Alwatr = { registeredList: alwatrRegisteredList });
8
7
  alwatrRegisteredList.push({
9
8
  name: '@alwatr/logger',
10
9
  version: '{{ALWATR_VERSION}}', // TODO: replace with real version at release time.
@@ -13,23 +12,25 @@ alwatrRegisteredList.push({
13
12
  * Color list storage for logger.
14
13
  */
15
14
  let colorIndex = 0;
16
- const colorList = [
17
- '#f05561',
18
- '#35b997',
19
- '#ee224a',
20
- '#91c13e',
21
- '#22af4b',
22
- '#f0e995',
23
- '#0fe995',
24
- '#0f89ca',
25
- '#08b9a5',
26
- '#fee851',
27
- '#ee573d',
28
- '#f9df30',
29
- '#1da2dc',
30
- '#f05123',
31
- '#ee2524',
32
- ];
15
+ const colorList = isBrowser ?
16
+ [
17
+ '#35b997',
18
+ '#f05561',
19
+ '#ee224a',
20
+ '#91c13e',
21
+ '#22af4b',
22
+ '#f0e995',
23
+ '#0fe995',
24
+ '#0f89ca',
25
+ '#08b9a5',
26
+ '#fee851',
27
+ '#ee573d',
28
+ '#f9df30',
29
+ '#1da2dc',
30
+ '#f05123',
31
+ '#ee2524',
32
+ ] :
33
+ ['0;36', '0;35', '0;34', '0;33', '0;32']; // red and white omitted
33
34
  const getNextColor = () => {
34
35
  const color = colorList[colorIndex];
35
36
  colorIndex++;
@@ -38,14 +39,21 @@ const getNextColor = () => {
38
39
  }
39
40
  return color;
40
41
  };
41
- const debugString = (_d = (_c = window.localStorage) === null || _c === void 0 ? void 0 : _c.getItem('ALWATR_LOG')) === null || _d === void 0 ? void 0 : _d.trim();
42
- const getDebugState = (scope, force) => {
42
+ const debugString = isBrowser ?
43
+ globalThis.localStorage?.getItem('ALWATR_DEBUG')?.trim() :
44
+ globalThis.process?.env?.ALWATR_DEBUG?.trim();
45
+ const getDebugState = (scope) => {
46
+ if (debugString == null && isBrowser === false && globalThis.process.env.NODE_ENV !== 'production') {
47
+ return true;
48
+ }
49
+ // prettier-ignore
43
50
  if (debugString == null ||
44
51
  debugString == '') {
45
52
  return false;
46
53
  }
47
- if (force ||
48
- debugString === scope ||
54
+ // prettier-ignore
55
+ if (debugString === scope ||
56
+ debugString === '*' ||
49
57
  (debugString.indexOf('*') === 0 && // starts with `*` for example: `*alwatr*`
50
58
  scope.indexOf(debugString.replaceAll('*', '')) !== -1) ||
51
59
  (debugString.indexOf('*') === debugString.length - 1 && // ends with `*` for example: `alwatr/*`
@@ -56,14 +64,14 @@ const getDebugState = (scope, force) => {
56
64
  return false;
57
65
  };
58
66
  export const style = {
59
- scope: 'color: {{color}};',
60
- reset: 'color: inherit;',
67
+ scope: isBrowser ? 'color: {{color}};' : '\x1b[{{color}}m',
68
+ reset: isBrowser ? 'color: inherit;' : '\x1b[0m',
61
69
  };
62
70
  /**
63
71
  * Create a logger function for fancy console debug with custom scope.
64
72
  *
65
73
  * - **color** is optional and automatically select from internal fancy color list.
66
- * - **force** is optional and default to false.
74
+ * - **debug** is optional and automatically detect from localStorage `ALWATR_DEBUG` item or `process.env.ALWATR_DEBUG`
67
75
  *
68
76
  * Example:
69
77
  *
@@ -72,15 +80,15 @@ export const style = {
72
80
  * const logger = createLogger('logger/demo');
73
81
  * ```
74
82
  */
75
- export const createLogger = (scope, color = getNextColor(), force = false) => {
83
+ export const createLogger = (scope, color = getNextColor(), debug = getDebugState(scope)) => {
76
84
  scope = scope.trim();
77
- const debug = getDebugState(scope, force);
78
85
  const first = scope.charAt(0);
79
86
  if (first !== '[' && first !== '{' && first !== '(' && first !== '<') {
80
87
  scope = '[' + scope + ']';
81
88
  }
82
89
  // eslint-disable-next-line @typescript-eslint/no-empty-function
83
90
  const empty = () => { };
91
+ const keySection = isBrowser ? '%c%s%c' : '%s%s%s';
84
92
  const styleScope = style.scope.replaceAll('{{color}}', color);
85
93
  /**
86
94
  * Required logger object, accident, error always reported even when the debug is false.
@@ -89,8 +97,12 @@ export const createLogger = (scope, color = getNextColor(), force = false) => {
89
97
  debug,
90
98
  color,
91
99
  scope,
92
- accident: console.warn.bind(console, '%c%s%c.%s => Accident: "%s" (%s)!', styleScope, scope, style.reset),
93
- error: console.error.bind(console, '%c%s%c.%s "%s" =>', styleScope, scope, style.reset),
100
+ accident: isBrowser ?
101
+ console.error.bind(console, '%c%s%c.%s "%s" => Accident: "%s" (%s)!', styleScope, scope, style.reset) :
102
+ console.error.bind(console, `${styleScope}⚠️ %s\x1b[33m.%s "%s" =>${style.reset}`, scope),
103
+ error: isBrowser ?
104
+ console.error.bind(console, '%c%s%c.%s "%s" =>', styleScope, scope, style.reset) :
105
+ console.error.bind(console, `${styleScope}❌ %s\x1b[31m.%s "%s" =>\x1b[0;2m`, scope),
94
106
  };
95
107
  if (!debug) {
96
108
  return {
@@ -106,12 +118,14 @@ export const createLogger = (scope, color = getNextColor(), force = false) => {
106
118
  // else if debug is true for this scope
107
119
  return {
108
120
  ...requiredItems,
109
- logProperty: console.debug.bind(console, '%c%s%c.%s = %o;', styleScope, scope, style.reset),
110
- logMethod: console.debug.bind(console, '%c%s%c.%s();', styleScope, scope, style.reset),
111
- logMethodArgs: console.debug.bind(console, '%c%s%c.%s(%o);', styleScope, scope, style.reset),
112
- logMethodFull: console.debug.bind(console, '%c%s%c.%s(%o); // %o', styleScope, scope, style.reset),
113
- incident: console.trace.bind(console, '%c%s%c.%s() => Incident: "%s" (%s)!', styleScope, scope, style.reset),
114
- logOther: console.debug.bind(console, '%c%s', styleScope, scope),
121
+ logProperty: console.debug.bind(console, keySection + '.%s = %o;', styleScope, scope, style.reset),
122
+ logMethod: console.debug.bind(console, keySection + '.%s();', styleScope, scope, style.reset),
123
+ logMethodArgs: console.debug.bind(console, keySection + '.%s(%o);', styleScope, scope, style.reset),
124
+ logMethodFull: console.debug.bind(console, keySection + '.%s(%o); // %o', styleScope, scope, style.reset),
125
+ incident: isBrowser ?
126
+ console.trace.bind(console, '%c%s%c.%s() => Incident: "%s" (%s)!', styleScope, scope, style.reset) :
127
+ console.log.bind(console, `${styleScope}🔸 %s${style.reset}.%s() => Incident: "%s" (%s)!\x1b[0;2m`, scope),
128
+ logOther: console.debug.bind(console, keySection, styleScope, scope, style.reset),
115
129
  };
116
130
  };
117
131
  //# sourceMappingURL=logger.js.map
package/logger.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":";AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,cAAc,KAAI,EAAE,CAAC;AACxE,MAAA,MAAM,CAAC,MAAM,oCAAb,MAAM,CAAC,MAAM,GAAK,EAAE,EAAC;AACrB,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,oBAAoB,CAAC;AAEpD,oBAAoB,CAAC,IAAI,CAAC;IACxB,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,oBAAoB,EAAE,mDAAmD;CACnF,CAAC,CAAC;AAEH;;GAEG;AACH,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,MAAM,SAAS,GAAG;IAChB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AAEF,MAAM,YAAY,GAAG,GAAW,EAAE;IAChC,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,UAAU,EAAE,CAAC;IACb,IAAI,UAAU,IAAI,SAAS,CAAC,MAAM,EAAE;QAClC,UAAU,GAAG,CAAC,CAAC;KAChB;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,MAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,OAAO,CAAC,YAAY,CAAC,0CAAE,IAAI,EAAE,CAAC;AACvE,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,KAAc,EAAY,EAAE;IAChE,IACE,WAAW,IAAI,IAAI;QACnB,WAAW,IAAI,EAAE,EACjB;QACA,OAAO,KA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KAAK,CAAC,KAAK,CAAC;KAClF,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/logger",
3
- "version": "0.11.0",
3
+ "version": "0.14.0",
4
4
  "description": "Fancy colorful console debugger with custom scope written in tiny TypeScript, ES module.",
5
5
  "keywords": [
6
6
  "log",
@@ -25,14 +25,14 @@
25
25
  "repository": {
26
26
  "type": "git",
27
27
  "url": "https://github.com/AliMD/alwatr",
28
- "directory": "package/logger"
28
+ "directory": "packages/core/logger"
29
29
  },
30
- "homepage": "https://github.com/AliMD/alwatr/tree/main/package/logger#readme",
30
+ "homepage": "https://github.com/AliMD/alwatr/tree/main/packages/core/logger#readme",
31
31
  "bugs": {
32
32
  "url": "https://github.com/AliMD/alwatr/issues"
33
33
  },
34
34
  "dependencies": {
35
35
  "tslib": "^2.3.1"
36
36
  },
37
- "gitHead": "7d734c552f37d65998f2f8bd57db7a64998dc9e4"
37
+ "gitHead": "05ead80d04053550d5ce72e9191fa2239ef4241b"
38
38
  }
package/type.d.ts CHANGED
@@ -1,12 +1,12 @@
1
+ export interface GlobalAlwatr {
2
+ registeredList: Array<{
3
+ name: string;
4
+ version: string;
5
+ }>;
6
+ }
1
7
  declare global {
2
- interface Window {
3
- Alwatr?: {
4
- registeredList?: Array<{
5
- name: string;
6
- version: string;
7
- }>;
8
- };
9
- }
8
+ var Alwatr: GlobalAlwatr;
9
+ var ALWATR_DEBUG: string | undefined;
10
10
  /**
11
11
  * @TODO: Make an issue to TS, WTF is this way! any better solution for more args in bind?!
12
12
  */
@@ -14,7 +14,7 @@ declare global {
14
14
  bind<T, A0, A1, A2, A3, A4, A extends unknown[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, arg4: A4, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, arg4: A4): (...args: A) => R;
15
15
  }
16
16
  }
17
- export interface Logger {
17
+ export interface AlwatrLogger {
18
18
  /**
19
19
  * Debug state for current scope base on localStorage `ALWATR_LOG` pattern.
20
20
  */
package/type.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["src/type.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE;YACP,cAAc,CAAC,EAAE,KAAK,CAAC;gBACrB,IAAI,EAAE,MAAM,CAAC;gBACb,OAAO,EAAE,MAAM,CAAC;aACjB,CAAC,CAAC;SACJ,CAAA;KACF;IAED;;OAEG;IACH,UAAU,gBAAgB;QACxB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,EAC/C,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,KACxE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;KAC5F;CACF;AAED,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAEpD;;;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