@blac/logging-plugin 2.0.11 → 2.0.12

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.
Files changed (2) hide show
  1. package/README.md +26 -34
  2. 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 state management. Logs instance lifecycle, state changes, events, and monitors for potential memory issues.
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
- **[Full documentation](https://jsnanigans.github.io/blac/plugins/logging)**
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
- ```typescript
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
- ```typescript
26
+ ```ts
27
27
  new LoggingPlugin({
28
- // Log verbosity: 'minimal' | 'info' | 'debug' | 'verbose'
28
+ // Verbosity: 'minimal' | 'info' | 'debug' | 'verbose'
29
29
  level: 'info',
30
30
 
31
- // Output format: 'simple' (one-line) | 'grouped' (console.group)
31
+ // Output: 'simple' (one-line) | 'grouped' (console.group)
32
32
  format: 'grouped',
33
33
 
34
34
  // Filtering
35
- include: ['CounterCubit', 'CartCubit'], // Only log these classes
36
- exclude: ['AnalyticsCubit'], // Exclude these classes
37
- filter: ({ className, isIsolated }) => !isIsolated, // Custom filter
35
+ include: ['CounterCubit', 'CartCubit'],
36
+ exclude: ['AnalyticsCubit'],
37
+ filter: ({ className, isIsolated }) => !isIsolated,
38
38
 
39
- // Feature toggles
40
- logLifecycle: true, // Log create/dispose
41
- logStateChanges: true, // Log state transitions
42
- includeCallstack: false, // Include callstack in logs
39
+ // What to log
40
+ logLifecycle: true,
41
+ logStateChanges: true,
42
+ includeCallstack: false,
43
43
 
44
44
  // Memory monitoring
45
- instanceCountWarningThreshold: 50, // Warn when exceeded
46
- detectRapidLifecycles: true, // Detect create/dispose loops
47
- rapidLifecycleWindowMs: 1000, // Time window for detection
48
- rapidLifecycleThreshold: 5, // Cycles to trigger warning
45
+ instanceCountWarningThreshold: 50,
46
+ detectRapidLifecycles: true,
47
+ rapidLifecycleWindowMs: 1000,
48
+ rapidLifecycleThreshold: 5,
49
49
 
50
50
  // State change batching
51
- debounceStateChanges: true, // Group rapid successive changes
52
- debounceWindowMs: 100, // Time window for batching
51
+ debounceStateChanges: true,
52
+ debounceWindowMs: 100,
53
53
 
54
54
  // Customization
55
- prefix: '[BlaC]', // Log prefix
56
- logger: console, // Custom logger
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 state changes (when multiple changes happen rapidly):**
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.11",
3
+ "version": "2.0.12",
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.10"
49
+ "@blac/core": "^2.0.11"
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.10"
56
+ "@blac/core": "2.0.11"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "vp pack --watch",