@alwatr/logger 4.0.5 → 4.0.7
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 +34 -23
- package/README.md +23 -23
- package/dist/main.cjs +2 -2
- package/dist/main.mjs +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,22 +3,33 @@
|
|
|
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
|
+
## [4.0.7](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.6...@alwatr/logger@4.0.7) (2024-10-25)
|
|
7
|
+
|
|
8
|
+
### Dependencies update
|
|
9
|
+
|
|
10
|
+
* bump the development-dependencies group across 1 directory with 2 updates ([2dfda9e](https://github.com/Alwatr/nanolib/commit/2dfda9ec38a595f1fd961490d1a2fbf060f20a66)) by @dependabot[bot]
|
|
11
|
+
* bump the development-dependencies group with 8 updates ([16847ac](https://github.com/Alwatr/nanolib/commit/16847acba91da027c422e3910d0f2dcc1f084e93)) by @dependabot[bot]
|
|
12
|
+
|
|
13
|
+
## [4.0.6](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.5...@alwatr/logger@4.0.6) (2024-10-12)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @alwatr/logger
|
|
16
|
+
|
|
6
17
|
## [4.0.5](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.4...@alwatr/logger@4.0.5) (2024-10-11)
|
|
7
18
|
|
|
8
19
|
### Bug Fixes
|
|
9
20
|
|
|
10
|
-
|
|
21
|
+
- **logger:** Update default debug mode logic for prevent side-effects ([42101d6](https://github.com/Alwatr/nanolib/commit/42101d6471bd0d4e88e47dc8321dddc1cd63cec8)) by @AliMD
|
|
11
22
|
|
|
12
23
|
### Code Refactoring
|
|
13
24
|
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
- **logger:** prevent side-effects ([e084894](https://github.com/Alwatr/nanolib/commit/e084894cdc4b46d52d99be872f5f789fe83c3cc0)) by @mohammadhonarvar
|
|
26
|
+
- prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
|
|
16
27
|
|
|
17
28
|
## [4.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.3...@alwatr/logger@4.0.4) (2024-10-11)
|
|
18
29
|
|
|
19
30
|
### Miscellaneous Chores
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
- include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @AliMD
|
|
22
33
|
|
|
23
34
|
## [4.0.3](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.2...@alwatr/logger@4.0.3) (2024-10-11)
|
|
24
35
|
|
|
@@ -28,7 +39,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
28
39
|
|
|
29
40
|
### Dependencies update
|
|
30
41
|
|
|
31
|
-
|
|
42
|
+
- bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
|
|
32
43
|
|
|
33
44
|
## [4.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@4.0.0...@alwatr/logger@4.0.1) (2024-10-08)
|
|
34
45
|
|
|
@@ -38,31 +49,31 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
38
49
|
|
|
39
50
|
### ⚠ BREAKING CHANGES
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
- **logger:** logModule renamed to logFileModule
|
|
53
|
+
- **logger:** definePackage and dedupt remove!
|
|
43
54
|
|
|
44
55
|
### Features
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
- **logger:** add logStep method to logger ([860aeed](https://github.com/Alwatr/nanolib/commit/860aeedb2da390ee3d47c037b22a37f73e6dbbbc)) by @AliMD
|
|
58
|
+
- use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
|
|
48
59
|
|
|
49
60
|
### Bug Fixes
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
- all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
|
|
52
63
|
|
|
53
64
|
### Code Refactoring
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
- **logger:** remove definePackage from logger ([c8a9d0c](https://github.com/Alwatr/nanolib/commit/c8a9d0cdcc3e45e7a33731ec6ee6a496451e9eb1)) by @mohammadhonarvar
|
|
67
|
+
- **logger:** rename logModule to logFileModule ([1f6bd71](https://github.com/Alwatr/nanolib/commit/1f6bd71272007f5bbc90258ffa13b7d851e0918c)) by @AliMD
|
|
57
68
|
|
|
58
69
|
### Miscellaneous Chores
|
|
59
70
|
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
- **logger:** change the license to AGPL-3.0 ([4bb4673](https://github.com/Alwatr/nanolib/commit/4bb4673972069a307e799cad9a5078b0288a9340)) by @AliMD
|
|
72
|
+
- Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @AliMD
|
|
62
73
|
|
|
63
74
|
### Dependencies update
|
|
64
75
|
|
|
65
|
-
|
|
76
|
+
- bump @types/node ([3d80fed](https://github.com/Alwatr/nanolib/commit/3d80fedaf720af792feb060c2f81c737ebb84e11)) by @dependabot[bot]
|
|
66
77
|
|
|
67
78
|
## [3.2.14](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.13...@alwatr/logger@3.2.14) (2024-09-21)
|
|
68
79
|
|
|
@@ -72,14 +83,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
72
83
|
|
|
73
84
|
### Dependencies update
|
|
74
85
|
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
- bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
|
|
87
|
+
- update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
|
|
77
88
|
|
|
78
89
|
## [3.2.12](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.11...@alwatr/logger@3.2.12) (2024-08-31)
|
|
79
90
|
|
|
80
91
|
### Miscellaneous Chores
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
- Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
|
|
83
94
|
|
|
84
95
|
## [3.2.11](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.10...@alwatr/logger@3.2.11) (2024-08-31)
|
|
85
96
|
|
|
@@ -89,19 +100,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
89
100
|
|
|
90
101
|
### Dependencies update
|
|
91
102
|
|
|
92
|
-
|
|
103
|
+
- update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @AliMD
|
|
93
104
|
|
|
94
105
|
## [3.2.9](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.8...@alwatr/logger@3.2.9) (2024-07-04)
|
|
95
106
|
|
|
96
107
|
### Dependencies update
|
|
97
108
|
|
|
98
|
-
|
|
109
|
+
- update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
|
|
99
110
|
|
|
100
111
|
## [3.2.8](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.7...@alwatr/logger@3.2.8) (2024-05-12)
|
|
101
112
|
|
|
102
113
|
### Dependencies update
|
|
103
114
|
|
|
104
|
-
|
|
115
|
+
- upgrade ([6dbd300](https://github.com/Alwatr/nanolib/commit/6dbd300642c9bcc9e7d0b281e244bf1b06eb1c38)) by @AliMD
|
|
105
116
|
|
|
106
117
|
## [3.2.7](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.6...@alwatr/logger@3.2.7) (2024-04-25)
|
|
107
118
|
|
|
@@ -115,11 +126,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
115
126
|
|
|
116
127
|
### Bug Fixes
|
|
117
128
|
|
|
118
|
-
|
|
129
|
+
- exported types by add .js extensions to all imports ([fc3d83e](https://github.com/Alwatr/nanolib/commit/fc3d83e8f375da97ba276314b2e6966aa82c9b3f)) by @AliMD
|
|
119
130
|
|
|
120
131
|
### Miscellaneous Chores
|
|
121
132
|
|
|
122
|
-
|
|
133
|
+
- **deps:** update ([1a45030](https://github.com/Alwatr/nanolib/commit/1a450305440b710a300787d4ca24b1ed8c6a39d7)) by @AliMD
|
|
123
134
|
|
|
124
135
|
## [3.2.4](https://github.com/Alwatr/nanolib/compare/@alwatr/logger@3.2.3...@alwatr/logger@3.2.4) (2024-01-24)
|
|
125
136
|
|
package/README.md
CHANGED
|
@@ -4,10 +4,10 @@ A lightweight, flexible, and colorful console logging library for TypeScript and
|
|
|
4
4
|
|
|
5
5
|
### Features
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- **Customizable Scopes:** Organize log messages using scopes for easy filtering and debugging.
|
|
8
|
+
- **Colorful Output:** Visually distinguish different log levels and scopes with vibrant colors.
|
|
9
|
+
- **Debug/Development Mode:** Control log verbosity to optimize performance in production environments.
|
|
10
|
+
- **Tiny Footprint:** Minimal overhead, keeping your project lean and efficient.
|
|
11
11
|
|
|
12
12
|
### Installation
|
|
13
13
|
|
|
@@ -18,33 +18,33 @@ npm install @alwatr/logger
|
|
|
18
18
|
### Usage
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
|
-
import {
|
|
21
|
+
import {createLogger} from '@alwatr/logger';
|
|
22
22
|
|
|
23
23
|
const logger = createLogger('my-module'); // Create a logger with a specific scope
|
|
24
24
|
|
|
25
25
|
function greet(name: string) {
|
|
26
|
-
logger.logMethodArgs?.('greet', {
|
|
27
|
-
console.log(`Hello, ${name}!`);
|
|
26
|
+
logger.logMethodArgs?.('greet', {name}); // Log the method call with its arguments
|
|
27
|
+
console.log(`Hello, ${name}!`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
greet('Ali');
|
|
30
|
+
greet('Ali');
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### Log Levels and Methods
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
- **`logProperty(propertyName, value)`:** Logs a property change (useful for tracking state).
|
|
36
|
+
- **`logFileModule(fileName)`:** Logs the module's file name for easy identification.
|
|
37
|
+
- **`logMethod(methodName)`:** Logs the entry into a function or method.
|
|
38
|
+
- **`logMethodArgs(methodName, args)`:** Logs a method call with its arguments.
|
|
39
|
+
- **`logStep(methodName, stepName, props?)`:** Logs specific steps within a method.
|
|
40
|
+
- **`logMethodFull(methodName, args, result)`:** Logs a method call with arguments and result.
|
|
41
|
+
- **`incident(methodName, code, ...args)`:** Logs an event or expected incident (informational).
|
|
42
|
+
- **`accident(methodName, code, ...args)`:** Logs an unexpected incident or handled error (warning).
|
|
43
|
+
- **`error(methodName, code, ...args)`:** Logs an unexpected error (critical).
|
|
44
|
+
- **`logOther(...args)`:** General-purpose logging with styled scope.
|
|
45
|
+
- **`time(label)`:** Starts a timer.
|
|
46
|
+
- **`timeEnd(label)`:** Ends a timer and logs the elapsed time.
|
|
47
|
+
- **`banner(message)`:** Logs a large, prominent banner message.
|
|
48
48
|
|
|
49
49
|
### Enabling Debug Mode
|
|
50
50
|
|
|
@@ -53,13 +53,13 @@ greet('Ali');
|
|
|
53
53
|
1. Open your browser's developer tools.
|
|
54
54
|
2. Go to the "Application" or "Storage" tab.
|
|
55
55
|
3. Find "Local Storage" and locate your application's domain.
|
|
56
|
-
4. Add a new key-value pair: `
|
|
56
|
+
4. Add a new key-value pair: `ALWATR_DEBUG` with the value `1`.
|
|
57
57
|
5. Reload the page.
|
|
58
58
|
|
|
59
59
|
Or use the following code snippet in the browser console:
|
|
60
60
|
|
|
61
61
|
```javascript
|
|
62
|
-
window.localStorage?.setItem('
|
|
62
|
+
window.localStorage?.setItem('ALWATR_DEBUG', '1');
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
> **Note:** Ensure the browser console's log level is set to include "Verbose" or "All" to see debug messages.
|
package/dist/main.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @alwatr/logger v4.0.
|
|
1
|
+
/* @alwatr/logger v4.0.7 */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(main_exports);
|
|
|
28
28
|
// src/logger.ts
|
|
29
29
|
var import_package_tracer = require("@alwatr/package-tracer");
|
|
30
30
|
var import_platform_info = require("@alwatr/platform-info");
|
|
31
|
-
__dev_mode__: import_package_tracer.packageTracer.add("@alwatr/logger", "4.0.
|
|
31
|
+
__dev_mode__: import_package_tracer.packageTracer.add("@alwatr/logger", "4.0.7");
|
|
32
32
|
var defaultDebugMode = /* @__PURE__ */ (() => {
|
|
33
33
|
return import_platform_info.platformInfo.development || (import_platform_info.platformInfo.isCli ? Boolean(process.env.DEBUG) : typeof localStorage !== "undefined" && localStorage.getItem("ALWATR_DEBUG") === "1");
|
|
34
34
|
})();
|
package/dist/main.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* @alwatr/logger v4.0.
|
|
1
|
+
/* @alwatr/logger v4.0.7 */
|
|
2
2
|
|
|
3
3
|
// src/logger.ts
|
|
4
4
|
import { packageTracer } from "@alwatr/package-tracer";
|
|
5
5
|
import { platformInfo } from "@alwatr/platform-info";
|
|
6
|
-
__dev_mode__: packageTracer.add("@alwatr/logger", "4.0.
|
|
6
|
+
__dev_mode__: packageTracer.add("@alwatr/logger", "4.0.7");
|
|
7
7
|
var defaultDebugMode = /* @__PURE__ */ (() => {
|
|
8
8
|
return platformInfo.development || (platformInfo.isCli ? Boolean(process.env.DEBUG) : typeof localStorage !== "undefined" && localStorage.getItem("ALWATR_DEBUG") === "1");
|
|
9
9
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/logger",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"description": "Fancy colorful console debugger with custom scope written in tiny TypeScript, ES module.",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -67,15 +67,15 @@
|
|
|
67
67
|
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@alwatr/package-tracer": "^1.0.
|
|
71
|
-
"@alwatr/platform-info": "^1.2.
|
|
70
|
+
"@alwatr/package-tracer": "^1.0.7",
|
|
71
|
+
"@alwatr/platform-info": "^1.2.7"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@alwatr/nano-build": "^2.0.
|
|
74
|
+
"@alwatr/nano-build": "^2.0.3",
|
|
75
75
|
"@alwatr/prettier-config": "^1.0.6",
|
|
76
|
-
"@alwatr/tsconfig-base": "^1.3.
|
|
77
|
-
"@types/node": "^22.
|
|
76
|
+
"@alwatr/tsconfig-base": "^1.3.3",
|
|
77
|
+
"@types/node": "^22.8.0",
|
|
78
78
|
"typescript": "^5.6.3"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "a1e430a02f9a5711fc43f19012091bcd8806c4f9"
|
|
81
81
|
}
|