@crimsonsunset/jsg-logger 1.1.6 โ†’ 1.2.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/CONTRIBUTING.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **This is a personal utility project that has been extracted and published for reuse.**
6
6
 
7
7
  Contributions are welcome, but please note:
8
- - This project emerged from a specific use case (Chrome Audio Control Platform)
8
+ - This project emerged from a specific use case but is now a generic multi-environment logger
9
9
  - The core functionality is stable and feature-complete for most use cases
10
10
  - Major architectural changes should be discussed in an issue first
11
11
 
package/README.md CHANGED
@@ -345,12 +345,12 @@ const stats = logger.controls.getStats();
345
345
  ### **๐Ÿš€ BREAKTHROUGH: Perfect Browser Formatting**
346
346
  ```
347
347
  // Direct browser logger with 100% style control:
348
- 12:00 AM ๐ŸŽฏ [CACP-CORE] โœจ CACP Extension v0.3.2 - Logger Ready!
348
+ 12:00 AM ๐ŸŽฏ [JSG-CORE] โœจ JSG Application v1.0.0 - Logger Ready!
349
349
  12:00 AM ๐ŸŽต [SOUNDCLOUD] MediaSession track change detected
350
350
  โ”œโ”€ title: Alt-J - Breezeblocks (Gkat Remix)
351
351
  โ”œโ”€ artist: Gkat
352
352
  โ”œโ”€ hasArtwork: true
353
- 12:00 AM ๐ŸŽฏ [CACP-CORE] ๐Ÿงช Testing JSON context display
353
+ 12:00 AM ๐ŸŽฏ [JSG-CORE] ๐Ÿงช Testing JSON context display
354
354
  โ”œโ”€ testData: {nested: {...}, simple: 'test string', boolean: true}
355
355
  โ”œโ”€ location: {href: 'https://soundcloud.com/discover', hostname: 'soundcloud.com'}
356
356
  โ”œโ”€ timestamp: 2025-07-29T06:00:53.837Z
@@ -4,16 +4,7 @@
4
4
  */
5
5
 
6
6
  export const COMPONENT_SCHEME = {
7
- 'cacp': { emoji: '๐ŸŽฏ', color: '#8E44AD', name: 'JSG-CORE' },
8
- 'soundcloud': { emoji: '๐ŸŽต', color: '#FF5500', name: 'SoundCloud' },
9
- 'youtube': { emoji: '๐Ÿ“น', color: '#FF0000', name: 'YouTube' },
10
- 'site-detector': { emoji: '๐Ÿ”', color: '#00C896', name: 'SiteDetector' },
11
- 'websocket': { emoji: '๐ŸŒ', color: '#9B59B6', name: 'WebSocket' },
12
- 'popup': { emoji: '๐ŸŽ›๏ธ', color: '#FF6B6B', name: 'Popup' },
13
- 'background': { emoji: '๐Ÿ”ง', color: '#4ECDC4', name: 'Background' },
14
- 'priority-manager': { emoji: 'โš–๏ธ', color: '#45B7D1', name: 'PriorityManager' },
15
- 'settings': { emoji: 'โš™๏ธ', color: '#96CEB4', name: 'Settings' },
16
- 'test': { emoji: '๐Ÿงช', color: '#FFEAA7', name: 'Test' }
7
+ 'core': { emoji: '๐ŸŽฏ', color: '#8E44AD', name: 'JSG-CORE' }
17
8
  };
18
9
 
19
10
  export const LEVEL_SCHEME = {
@@ -406,7 +406,7 @@ export class ConfigManager {
406
406
  * @returns {Object} Component configuration
407
407
  */
408
408
  getComponentConfig(componentName, filePath = null) {
409
- const baseComponent = this.config.components?.[componentName] || COMPONENT_SCHEME[componentName] || COMPONENT_SCHEME['cacp'];
409
+ const baseComponent = this.config.components?.[componentName] || COMPONENT_SCHEME[componentName] || COMPONENT_SCHEME['core'];
410
410
 
411
411
  // Check for file-specific overrides
412
412
  const checkFile = filePath || this.currentFile;
@@ -26,65 +26,11 @@
26
26
  "60": { "name": "FATAL", "emoji": "๐Ÿ’€", "color": "#D63031" }
27
27
  },
28
28
  "components": {
29
- "cacp": {
29
+ "core": {
30
30
  "emoji": "๐ŸŽฏ",
31
31
  "color": "#4A90E2",
32
32
  "name": "JSG-CORE",
33
33
  "level": "info"
34
- },
35
- "soundcloud": {
36
- "emoji": "๐ŸŽต",
37
- "color": "#FF5500",
38
- "name": "SoundCloud",
39
- "level": "info"
40
- },
41
- "youtube": {
42
- "emoji": "๐Ÿ“น",
43
- "color": "#FF0000",
44
- "name": "YouTube",
45
- "level": "info"
46
- },
47
- "site-detector": {
48
- "emoji": "๐Ÿ”",
49
- "color": "#00C896",
50
- "name": "SiteDetector",
51
- "level": "info"
52
- },
53
- "websocket": {
54
- "emoji": "๐ŸŒ",
55
- "color": "#9B59B6",
56
- "name": "WebSocket",
57
- "level": "info"
58
- },
59
- "popup": {
60
- "emoji": "๐ŸŽ›๏ธ",
61
- "color": "#FF6B6B",
62
- "name": "Popup",
63
- "level": "info"
64
- },
65
- "background": {
66
- "emoji": "๐Ÿ”ง",
67
- "color": "#4ECDC4",
68
- "name": "Background",
69
- "level": "info"
70
- },
71
- "priority-manager": {
72
- "emoji": "โš–๏ธ",
73
- "color": "#45B7D1",
74
- "name": "PriorityManager",
75
- "level": "info"
76
- },
77
- "settings": {
78
- "emoji": "โš™๏ธ",
79
- "color": "#96CEB4",
80
- "name": "Settings",
81
- "level": "info"
82
- },
83
- "test": {
84
- "emoji": "๐Ÿงช",
85
- "color": "#FFEAA7",
86
- "name": "Test",
87
- "level": "debug"
88
34
  }
89
35
  },
90
36
  "fileOverrides": {
@@ -68,10 +68,10 @@
68
68
  **Solution**: Build essential patterns directly into the JSG Logger package
69
69
 
70
70
  ### **โœ… COMPLETED THIS SESSION:**
71
- - [x] **Static Singleton Pattern** - `CACPLogger.getInstance()` methods
71
+ - [x] **Static Singleton Pattern** - `JSGLogger.getInstance()` methods
72
72
  - [x] **Auto-Discovery Getters** - Both camelCase and kebab-case component access
73
73
  - [x] **Non-Destructive Error Handling** - Missing components log but don't break
74
- - [x] **Static Performance Logging** - `CACPLogger.logPerformance()` utility
74
+ - [x] **Static Performance Logging** - `JSGLogger.logPerformance()` utility
75
75
  - [x] **Enhanced Export Structure** - Components and getComponent available
76
76
 
77
77
  ### **โœ… PHASE 8 API ENHANCEMENT COMPLETE:**
package/docs/roadmap.md CHANGED
@@ -21,9 +21,9 @@
21
21
 
22
22
  ## ๐ŸŽฏ Current Status
23
23
  **Last Updated:** August 21, 2025
24
- **Current Phase:** Phase 9 - Genericize Logger (Remove CACP Hardcoding)
25
- **Status:** ๐Ÿš€ **IN PROGRESS** - Making JSG Logger truly generic by removing CACP-specific hardcoded components
26
- **Current Issue:** Logger still loads CACP defaults instead of project-specific `logger-config.json` files
24
+ **Current Phase:** Phase 9 - Genericize Logger (Remove Legacy Hardcoding)
25
+ **Status:** ๐Ÿš€ **IN PROGRESS** - Making JSG Logger truly generic by removing legacy-specific hardcoded components
26
+ **Current Issue:** Logger still loads legacy defaults instead of project-specific `logger-config.json` files
27
27
 
28
28
  ### Progress Overview
29
29
  - โœ… **COMPLETED:** Multi-environment logger with smart detection
@@ -340,22 +340,22 @@ Console filtering updates
340
340
 
341
341
  ## ๐Ÿ“ˆ Recent Progress
342
342
 
343
- ### August 21, 2025 - Phase 9 Discovery: CACP Hardcoding Issues ๐Ÿ”
344
- - ๐Ÿ› **Critical Discovery**: JSG Logger still deeply hardcoded for CACP use cases
345
- - ๐Ÿ” **Issue Identified**: `logger-config.json` files being ignored, falling back to CACP defaults
343
+ ### August 21, 2025 - Phase 9 Discovery: Legacy Hardcoding Issues ๐Ÿ”
344
+ - ๐Ÿ› **Critical Discovery**: JSG Logger still deeply hardcoded for legacy use cases
345
+ - ๐Ÿ” **Issue Identified**: `logger-config.json` files being ignored, falling back to legacy defaults
346
346
  - ๐Ÿ“‹ **Root Causes Documented**: 6 major areas requiring genericization
347
- 1. `CACPLogger` class name and all references
348
- 2. Default config with 10 hardcoded CACP components
347
+ 1. `JSGLogger` class name and all references โœ… COMPLETED
348
+ 2. Default config with 10 hardcoded legacy components
349
349
  3. Component schemes duplication
350
- 4. Hardcoded legacy aliases for CACP components
351
- 5. Core component dependency on 'cacp' logger
350
+ 4. Hardcoded legacy aliases for legacy components
351
+ 5. โœ… Core component dependency on 'core' logger
352
352
  6. Config loading path resolution issues
353
353
  - ๐ŸŽฏ **Phase 9 Planned**: Complete roadmap for making logger truly generic
354
354
  - โœ… **Testing Successful**: JSG Logger v1.1.0 API features work, but components wrong
355
355
 
356
356
  ### August 21, 2025 - Phase 8 API Enhancement Complete โœ…
357
357
  - โœ… **JSG Logger v1.1.0** - Major API simplification enhancements shipped
358
- - โœ… **Static Singleton Pattern** - `CACPLogger.getInstance()` with auto-initialization
358
+ - โœ… **Static Singleton Pattern** - `JSGLogger.getInstance()` with auto-initialization
359
359
  - โœ… **Auto-Discovery Components** - Both camelCase and kebab-case access patterns
360
360
  - โœ… **Non-Destructive Error Handling** - Missing components log but don't break apps
361
361
  - โœ… **Built-in Performance Logging** - `JSGLogger.logPerformance()` static utility
@@ -433,7 +433,7 @@ Projects using JSG Logger currently need to implement ~220 lines of boilerplate:
433
433
  #### **Solution - Built-in Enhancement Features**
434
434
 
435
435
  **โœ… Design Decisions Made:**
436
- 1. **getInstance location**: Static on CACPLogger class
436
+ 1. **getInstance location**: Static on JSGLogger class
437
437
  2. **Auto-discovery naming**: Both camelCase and kebab-case support
438
438
  3. **Performance logging**: Static utility `JSGLogger.logPerformance(...)`
439
439
  4. **Error handling**: Non-destructive with helpful logging (no fallbacks)
@@ -444,12 +444,12 @@ Projects using JSG Logger currently need to implement ~220 lines of boilerplate:
444
444
 
445
445
  ##### **Enhancement 1: Static Singleton Pattern**
446
446
  ```javascript
447
- // Static method on CACPLogger class
448
- const logger = CACPLogger.getInstance(config);
449
- const logger2 = CACPLogger.getInstance(); // Same instance, no config needed
447
+ // Static method on JSGLogger class
448
+ const logger = JSGLogger.getInstance(config);
449
+ const logger2 = JSGLogger.getInstance(); // Same instance, no config needed
450
450
  ```
451
451
 
452
- **Implementation Location**: `index.js` CACPLogger class
452
+ **Implementation Location**: `index.js` JSGLogger class
453
453
  - Add `static _instance = null`
454
454
  - Add `static async getInstance(options = {})`
455
455
  - Add `static getInstanceSync(options = {})` for sync environments
@@ -575,65 +575,61 @@ export { logger, JSGLogger };
575
575
 
576
576
  ---
577
577
 
578
- ### **Phase 9: Genericize Logger (Remove CACP Hardcoding)** ๐Ÿš€ IN PROGRESS
579
- **Goal**: Make JSG Logger truly generic by removing all CACP-specific hardcoded components and references
578
+ ### **Phase 9: Genericize Logger (Remove Legacy Hardcoding)** ๐Ÿš€ IN PROGRESS
579
+ **Goal**: Make JSG Logger truly generic by removing all legacy-specific hardcoded components and references
580
580
 
581
581
  #### **Background - The Problem**
582
- During Phase 8 integration testing with jsg-tech-check-site, we discovered the logger is still deeply hardcoded for CACP (Chrome Audio Control Panel) use cases:
582
+ During Phase 8 integration testing with jsg-tech-check-site, we discovered the logger is still deeply hardcoded for legacy use cases:
583
583
 
584
584
  **Observable Issues:**
585
585
  ```
586
- [JSG-LOGGER] Component 'astro-build' not found. Available: cacp, soundcloud, youtube, site-detector, websocket, popup, background, priority-manager, settings, test, siteDetector, priorityManager
586
+ [JSG-LOGGER] Component 'astro-build' not found. Available: core
587
587
  ```
588
588
 
589
- Despite providing a proper `logger-config.json` with Astro-specific components, the logger falls back to CACP defaults instead of loading the project's configuration.
589
+ Despite providing a proper `logger-config.json` with Astro-specific components, the logger falls back to legacy defaults instead of loading the project's configuration.
590
590
 
591
- #### **Root Causes - What Makes It CACP-Specific**
591
+ #### **Root Causes - What Makes It Legacy-Specific**
592
592
 
593
593
  ##### **1. Class Name & Core References**
594
- - `CACPLogger` class name should be `JSGLogger` or `GenericLogger`
595
- - All static method references (`CACPLogger.getInstance()`, etc.)
596
- - Error messages mentioning "CACP Logger"
597
- - `window.CACP_Logger` global should be `window.JSG_Logger`
594
+ - โœ… `JSGLogger` class name updated
595
+ - โœ… All static method references (`JSGLogger.getInstance()`, etc.)
596
+ - โœ… Error messages mentioning "JSG Logger"
597
+ - โœ… `window.JSG_Logger` global updated
598
598
 
599
599
  ##### **2. Default Configuration Hardcoding**
600
600
  **File:** `/config/default-config.json`
601
- - **Hardcoded project name**: `"CACP Logger"`
602
- - **10 CACP-specific components**:
603
- - `cacp` (๐ŸŽฏ CACP-CORE) - should be generic `core`
604
- - `soundcloud` (๐ŸŽต SoundCloud)
605
- - `youtube` (๐Ÿ“น YouTube)
606
- - `site-detector` (๐Ÿ” SiteDetector)
607
- - `websocket` (๐ŸŒ WebSocket)
608
- - `popup` (๐ŸŽ›๏ธ Popup)
609
- - `background` (๐Ÿ”ง Background)
610
- - `priority-manager` (โš–๏ธ PriorityManager)
611
- - `settings` (โš™๏ธ Settings)
612
- - `test` (๐Ÿงช Test)
601
+ - **Hardcoded project name**: โœ… `"JSG Logger"`
602
+ - โœ… **Minimal generic components**: Only `core` component by default
603
+ - โœ… **Projects define their own**: Components specified in project config files
613
604
 
614
605
  ##### **3. Component Schemes Duplication**
615
606
  **File:** `/config/component-schemes.js`
616
- - Duplicates the same 10 hardcoded CACP components
607
+ - Duplicates the same 10 hardcoded legacy components
617
608
  - Should be empty/minimal by default for generic usage
618
609
 
619
610
  ##### **4. Hardcoded Legacy Aliases**
620
611
  ```javascript
621
612
  // In createAliases() method:
622
- this.loggers.siteDetector = this.loggers['site-detector'];
623
- this.loggers.priorityManager = this.loggers['priority-manager'];
613
+ // Auto-generate camelCase aliases for kebab-case components
614
+ Object.keys(this.loggers).forEach(componentName => {
615
+ if (componentName.includes('-')) {
616
+ const camelCase = componentName.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
617
+ this.loggers[camelCase] = this.loggers[componentName];
618
+ }
619
+ });
624
620
  ```
625
621
 
626
622
  ##### **5. Core Component Dependency**
627
623
  ```javascript
628
- // Initialization requires 'cacp' component:
629
- if (this.loggers.cacp) {
630
- this.loggers.cacp.info('CACP Logger initialized', {...});
624
+ // Initialization uses 'core' component:
625
+ if (this.loggers.core) {
626
+ this.loggers.core.info('JSG Logger initialized', {...});
631
627
  }
632
628
  ```
633
629
 
634
630
  ##### **6. Config Loading Path Issue**
635
631
  - **Critical**: The logger isn't loading our `logger-config.json` properly
636
- - Falls back to default CACP config instead of using project-specific configurations
632
+ - Falls back to default legacy config instead of using project-specific configurations
637
633
  - **Why our Astro config is ignored**: Path resolution or config merging logic issues
638
634
 
639
635
  #### **๐Ÿ”ง Implementation Plan**
@@ -657,10 +653,10 @@ if (this.loggers.cacp) {
657
653
 
658
654
  ##### **Fix 2: Rename Core Class**
659
655
  **Target**: `/index.js`
660
- - `CACPLogger` โ†’ `JSGLogger`
656
+ - โœ… `JSGLogger` class renamed
661
657
  - Update all static method references
662
658
  - Update error messages
663
- - Update browser global: `window.CACP_Logger` โ†’ `window.JSG_Logger`
659
+ - โœ… Update browser global: `window.JSG_Logger`
664
660
 
665
661
  ##### **Fix 3: Fix Config Loading**
666
662
  **Target**: Config manager and initialization
@@ -668,34 +664,34 @@ if (this.loggers.cacp) {
668
664
  - Ensure project configs override defaults instead of falling back
669
665
  - Fix path resolution for various environments (Node.js vs browser)
670
666
 
671
- ##### **Fix 4: Remove CACP-Specific Logic**
667
+ ##### **Fix 4: Remove Legacy-Specific Logic**
672
668
  **Target**: `/index.js` `createAliases()` method
673
- - Remove hardcoded legacy aliases for `siteDetector`, `priorityManager`
669
+ - โœ… Remove hardcoded legacy aliases, use generic camelCase generation
674
670
  - Make aliases configurable if needed, not hardcoded
675
671
 
676
672
  ##### **Fix 5: Use Configurable Core Component**
677
673
  **Target**: Initialization logging
678
- - Replace `this.loggers.cacp.info()` with configurable core component
674
+ - โœ… Replace `this.loggers.core.info()` with generic core component
679
675
  - Use `this.loggers.core` or first available component
680
676
  - Graceful fallback if no components configured
681
677
 
682
678
  ##### **Fix 6: Clean Component Schemes**
683
679
  **Target**: `/config/component-schemes.js`
684
- - Remove all CACP-specific hardcoded components
680
+ - Remove all legacy-specific hardcoded components
685
681
  - Keep only minimal example or make it empty
686
682
  - Let projects define their own components
687
683
 
688
684
  #### **๐ŸŽฏ Success Criteria**
689
- 1. โœ… **Generic by Default**: Fresh installations work without CACP references
685
+ 1. โœ… **Generic by Default**: Fresh installations work without legacy references
690
686
  2. โœ… **Config Loading Works**: Project-specific `logger-config.json` files are properly loaded
691
- 3. โœ… **No CACP Dependencies**: Logger works without any CACP-specific components
692
- 4. โœ… **Clean API**: `JSGLogger.getInstance()` instead of `CACPLogger.getInstance()`
687
+ 3. โœ… **No Legacy Dependencies**: Logger works without any legacy-specific components
688
+ 4. โœ… **Clean API**: `JSGLogger.getInstance()` working correctly
693
689
  5. โœ… **Test with Real Project**: jsg-tech-check-site loads Astro components correctly
694
690
 
695
691
  #### **๐Ÿ“‹ Implementation Steps**
696
692
  1. **Debug config loading** - Fix why `logger-config.json` is ignored
697
- 2. **Rename core class** - `CACPLogger` โ†’ `JSGLogger`
698
- 3. **Replace default config** - Remove 10 CACP components, use minimal generic
693
+ 2. โœ… **Rename core class** - `JSGLogger` completed
694
+ 3. โœ… **Replace default config** - Minimal generic with only 'core' component
699
695
  4. **Remove hardcoded aliases** - Make legacy aliases configurable
700
696
  5. **Fix core component** - Use configurable core for init logging
701
697
  6. **Update browser global** - `window.JSG_Logger`
@@ -11,141 +11,131 @@
11
11
  "timestamp": true,
12
12
  "emoji": true,
13
13
  "component": true,
14
- "level": false,
14
+ "level": true,
15
15
  "message": true,
16
16
  "jsonPayload": true,
17
17
  "stackTrace": true
18
18
  },
19
19
  "components": {
20
- "cacp": {
20
+ "core": {
21
21
  "emoji": "๐ŸŽฏ",
22
22
  "color": "#4A90E2",
23
23
  "name": "JSG-CORE",
24
24
  "level": "debug"
25
25
  },
26
- "soundcloud": {
27
- "emoji": "๐ŸŽต",
26
+ "api": {
27
+ "emoji": "๐Ÿ”Œ",
28
28
  "color": "#FF5500",
29
- "name": "SoundCloud",
29
+ "name": "API",
30
30
  "level": "trace"
31
31
  },
32
- "youtube": {
33
- "emoji": "๐Ÿ“น",
32
+ "database": {
33
+ "emoji": "๐Ÿ’พ",
34
34
  "color": "#FF0000",
35
- "name": "YouTube",
35
+ "name": "Database",
36
36
  "level": "info"
37
37
  },
38
- "site-detector": {
39
- "emoji": "๐Ÿ”",
38
+ "auth": {
39
+ "emoji": "๐Ÿ”",
40
40
  "color": "#00C896",
41
- "name": "SiteDetector",
41
+ "name": "Auth",
42
42
  "level": "debug"
43
43
  },
44
- "websocket": {
45
- "emoji": "๐ŸŒ",
44
+ "utils": {
45
+ "emoji": "๐Ÿ› ๏ธ",
46
46
  "color": "#9B59B6",
47
- "name": "WebSocket",
47
+ "name": "Utils",
48
48
  "level": "warn"
49
49
  },
50
- "popup": {
51
- "emoji": "๐ŸŽ›๏ธ",
50
+ "ui": {
51
+ "emoji": "๐ŸŽจ",
52
52
  "color": "#FF6B6B",
53
- "name": "Popup",
54
- "level": "debug"
55
- },
56
- "background": {
57
- "emoji": "๐Ÿ”ง",
58
- "color": "#4ECDC4",
59
- "name": "Background",
53
+ "name": "UI",
60
54
  "level": "info"
61
55
  },
62
- "priority-manager": {
63
- "emoji": "โš–๏ธ",
64
- "color": "#45B7D1",
65
- "name": "PriorityManager",
66
- "level": "warn"
67
- },
68
- "settings": {
56
+ "service": {
69
57
  "emoji": "โš™๏ธ",
70
- "color": "#96CEB4",
71
- "name": "Settings",
72
- "level": "info"
58
+ "color": "#4ECDC4",
59
+ "name": "Service",
60
+ "level": "error"
73
61
  },
74
62
  "test": {
75
63
  "emoji": "๐Ÿงช",
76
64
  "color": "#FFEAA7",
77
65
  "name": "Test",
78
- "level": "trace"
66
+ "level": "debug"
79
67
  }
80
68
  },
81
- "fileOverrides": {
82
- "src/sites/soundcloud.js": {
83
- "level": "trace",
84
- "component": "soundcloud",
85
- "emoji": "๐ŸŽต",
69
+ "environments": {
70
+ "development": {
71
+ "globalLevel": "debug",
86
72
  "display": {
87
- "timestamp": true,
88
- "emoji": true,
89
- "component": true,
90
73
  "level": true,
91
- "message": true,
92
- "jsonPayload": true,
74
+ "timestamp": true,
93
75
  "stackTrace": true
76
+ },
77
+ "components": {
78
+ "api": "trace",
79
+ "database": "debug",
80
+ "auth": "trace"
94
81
  }
95
82
  },
96
- "src/managers/*.js": {
97
- "level": "warn",
83
+ "test": {
84
+ "globalLevel": "warn",
98
85
  "display": {
99
- "jsonPayload": false
86
+ "emoji": false,
87
+ "timestamp": false
88
+ },
89
+ "components": {
90
+ "test": "trace",
91
+ "api": "debug"
100
92
  }
101
93
  },
102
- "src/popup.js": {
103
- "level": "debug",
104
- "emoji": "๐ŸŽ›๏ธ",
105
- "timestampMode": "relative",
94
+ "production": {
95
+ "globalLevel": "error",
106
96
  "display": {
107
- "timestamp": true,
108
- "emoji": true,
109
- "component": true,
110
- "level": false,
111
- "message": true,
112
- "jsonPayload": false,
97
+ "emoji": false,
98
+ "component": false,
99
+ "stackTrace": false
100
+ },
101
+ "components": {
102
+ "core": "warn",
103
+ "auth": "info",
104
+ "api": "warn"
105
+ }
106
+ }
107
+ },
108
+ "fileOverrides": {
109
+ "src/api/auth.js": {
110
+ "level": "trace",
111
+ "component": "auth",
112
+ "description": "Debug auth endpoints",
113
+ "display": {
114
+ "jsonPayload": true,
113
115
  "stackTrace": true
114
116
  }
115
117
  },
116
- "src/background.js": {
118
+ "src/database/*.js": {
119
+ "level": "debug",
120
+ "component": "database",
121
+ "description": "Database operations debugging"
122
+ },
123
+ "src/ui/components/**": {
117
124
  "level": "info",
125
+ "component": "ui",
126
+ "description": "UI component lifecycle",
118
127
  "display": {
119
128
  "jsonPayload": false,
120
129
  "stackTrace": false
121
130
  }
122
131
  },
123
- "src/cacp.js": {
132
+ "src/core.js": {
124
133
  "level": "debug",
125
134
  "emoji": "๐ŸŽฏ",
126
135
  "display": {
127
136
  "level": true,
128
137
  "jsonPayload": true
129
138
  }
130
- },
131
- "src/sites/youtube.js": {
132
- "level": "info",
133
- "emoji": "๐Ÿ“น",
134
- "timestampMode": "readable",
135
- "display": {
136
- "timestamp": true,
137
- "jsonPayload": false
138
- }
139
- },
140
- "src/test-*.js": {
141
- "level": "trace",
142
- "emoji": "๐Ÿงช",
143
- "timestampMode": "disable",
144
- "display": {
145
- "timestamp": false,
146
- "level": true,
147
- "jsonPayload": true
148
- }
149
139
  }
150
140
  }
151
141
  }
@@ -25,7 +25,7 @@ export const createCLIFormatter = () => {
25
25
  const log = JSON.parse(chunk);
26
26
 
27
27
  // Get component info
28
- const component = COMPONENT_SCHEME[log.name] || COMPONENT_SCHEME['cacp'];
28
+ const component = COMPONENT_SCHEME[log.name] || COMPONENT_SCHEME['core'];
29
29
  const componentName = component.name.toUpperCase().replace(/([a-z])([A-Z])/g, '$1-$2');
30
30
 
31
31
  // Get level info
package/index.js CHANGED
@@ -86,8 +86,8 @@ class JSGLogger {
86
86
  this.initialized = true;
87
87
 
88
88
  // Log initialization success
89
- if (this.loggers.cacp) {
90
- this.loggers.cacp.info('JSG Logger initialized', {
89
+ if (this.loggers.core) {
90
+ this.loggers.core.info('JSG Logger initialized', {
91
91
  environment: this.environment,
92
92
  components: components.length,
93
93
  projectName: configManager.getProjectName(),
@@ -129,8 +129,8 @@ class JSGLogger {
129
129
  this.initialized = true;
130
130
 
131
131
  // Log initialization success
132
- if (this.loggers.cacp) {
133
- this.loggers.cacp.info('JSG Logger initialized (sync)', {
132
+ if (this.loggers.core) {
133
+ this.loggers.core.info('JSG Logger initialized (sync)', {
134
134
  environment: this.environment,
135
135
  components: components.length,
136
136
  projectName: configManager.getProjectName(),
@@ -184,13 +184,17 @@ class JSGLogger {
184
184
  }
185
185
 
186
186
  /**
187
- * Create legacy compatibility aliases
187
+ * Create component aliases (for camelCase/kebab-case compatibility)
188
188
  * @private
189
189
  */
190
190
  createAliases() {
191
- // Legacy compatibility for existing codebase
192
- this.loggers.siteDetector = this.loggers['site-detector'];
193
- this.loggers.priorityManager = this.loggers['priority-manager'];
191
+ // Auto-generate camelCase aliases for kebab-case component names
192
+ Object.keys(this.loggers).forEach(componentName => {
193
+ if (componentName.includes('-')) {
194
+ const camelCase = componentName.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase());
195
+ this.loggers[camelCase] = this.loggers[componentName];
196
+ }
197
+ });
194
198
  }
195
199
 
196
200
  /**
@@ -428,7 +432,7 @@ class JSGLogger {
428
432
  };
429
433
 
430
434
  return {
431
- cacp: fallback,
435
+ core: fallback,
432
436
  createLogger: () => fallback,
433
437
  config: {environment: 'fallback'},
434
438
  logStore: {getRecent: () => [], clear: () => {}},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crimsonsunset/jsg-logger",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "JSG Logger - Multi-environment logger with smart detection, file-level overrides, and beautiful console formatting",
6
6
  "main": "index.js",