@blac/logging-plugin 2.0.11 → 2.0.13
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 +26 -34
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @blac/logging-plugin
|
|
2
2
|
|
|
3
|
-
Logging and debugging plugin for BlaC
|
|
3
|
+
Logging and debugging plugin for BlaC. Logs lifecycle events, state changes, and monitors for potential memory issues like leaked instances and rapid create/dispose cycles.
|
|
4
4
|
|
|
5
|
-
**[
|
|
5
|
+
**[Documentation](https://blac-docs.pages.dev/plugins/logging)** · **[npm](https://www.npmjs.com/package/@blac/logging-plugin)**
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ pnpm add @blac/logging-plugin
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
```
|
|
15
|
+
```ts
|
|
16
16
|
import { getPluginManager } from '@blac/core';
|
|
17
17
|
import { LoggingPlugin } from '@blac/logging-plugin';
|
|
18
18
|
|
|
@@ -23,37 +23,37 @@ getPluginManager().install(new LoggingPlugin(), {
|
|
|
23
23
|
|
|
24
24
|
## Configuration
|
|
25
25
|
|
|
26
|
-
```
|
|
26
|
+
```ts
|
|
27
27
|
new LoggingPlugin({
|
|
28
|
-
//
|
|
28
|
+
// Verbosity: 'minimal' | 'info' | 'debug' | 'verbose'
|
|
29
29
|
level: 'info',
|
|
30
30
|
|
|
31
|
-
// Output
|
|
31
|
+
// Output: 'simple' (one-line) | 'grouped' (console.group)
|
|
32
32
|
format: 'grouped',
|
|
33
33
|
|
|
34
34
|
// Filtering
|
|
35
|
-
include: ['CounterCubit', 'CartCubit'],
|
|
36
|
-
exclude: ['AnalyticsCubit'],
|
|
37
|
-
filter: ({ className, isIsolated }) => !isIsolated,
|
|
35
|
+
include: ['CounterCubit', 'CartCubit'],
|
|
36
|
+
exclude: ['AnalyticsCubit'],
|
|
37
|
+
filter: ({ className, isIsolated }) => !isIsolated,
|
|
38
38
|
|
|
39
|
-
//
|
|
40
|
-
logLifecycle: true,
|
|
41
|
-
logStateChanges: true,
|
|
42
|
-
includeCallstack: false,
|
|
39
|
+
// What to log
|
|
40
|
+
logLifecycle: true,
|
|
41
|
+
logStateChanges: true,
|
|
42
|
+
includeCallstack: false,
|
|
43
43
|
|
|
44
44
|
// Memory monitoring
|
|
45
|
-
instanceCountWarningThreshold: 50,
|
|
46
|
-
detectRapidLifecycles: true,
|
|
47
|
-
rapidLifecycleWindowMs: 1000,
|
|
48
|
-
rapidLifecycleThreshold: 5,
|
|
45
|
+
instanceCountWarningThreshold: 50,
|
|
46
|
+
detectRapidLifecycles: true,
|
|
47
|
+
rapidLifecycleWindowMs: 1000,
|
|
48
|
+
rapidLifecycleThreshold: 5,
|
|
49
49
|
|
|
50
50
|
// State change batching
|
|
51
|
-
debounceStateChanges: true,
|
|
52
|
-
debounceWindowMs: 100,
|
|
51
|
+
debounceStateChanges: true,
|
|
52
|
+
debounceWindowMs: 100,
|
|
53
53
|
|
|
54
54
|
// Customization
|
|
55
|
-
prefix: '[BlaC]',
|
|
56
|
-
logger: console,
|
|
55
|
+
prefix: '[BlaC]',
|
|
56
|
+
logger: console,
|
|
57
57
|
});
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -84,24 +84,12 @@ new LoggingPlugin({
|
|
|
84
84
|
Current: 1
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
**Batched
|
|
87
|
+
**Batched:**
|
|
88
88
|
|
|
89
89
|
```
|
|
90
90
|
[BlaC] CounterCubit#abc12345 state: 0 → 5 (5 changes batched)
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
```
|
|
94
|
-
▼ [BlaC] CounterCubit#abc12345 state changed (5 batched)
|
|
95
|
-
Initial: 0
|
|
96
|
-
Final: 5
|
|
97
|
-
▼ All changes
|
|
98
|
-
1. 0 → 1
|
|
99
|
-
2. 1 → 2
|
|
100
|
-
3. 2 → 3
|
|
101
|
-
4. 3 → 4
|
|
102
|
-
5. 4 → 5
|
|
103
|
-
```
|
|
104
|
-
|
|
105
93
|
**Warnings:**
|
|
106
94
|
|
|
107
95
|
```
|
|
@@ -109,3 +97,7 @@ new LoggingPlugin({
|
|
|
109
97
|
[BlaC] ⚠️ Rapid lifecycle: CounterCubit created/disposed 5 times in 1000ms
|
|
110
98
|
[BlaC] ⚠️ Unused instance: FormCubit#abc12345 disposed without state changes
|
|
111
99
|
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blac/logging-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Brendan Mullins <jsnanigans@gmail.com>",
|
|
6
6
|
"description": "Logging and debugging plugin for BlaC state management",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"devtools"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@blac/core": "^2.0.
|
|
49
|
+
"@blac/core": "^2.0.12"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"typescript": "^5.9.2",
|
|
53
53
|
"vitest": "npm:@voidzero-dev/vite-plus-test@latest",
|
|
54
54
|
"publint": "^0.3.12",
|
|
55
55
|
"vite-plus": "latest",
|
|
56
|
-
"@blac/core": "2.0.
|
|
56
|
+
"@blac/core": "2.0.12"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "vp pack --watch",
|