@crimsonsunset/jsg-logger 1.7.2 → 1.7.5

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
@@ -5,6 +5,58 @@ All notable changes to the JSG Logger project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.7.5] - 2025-11-06 🎛️ **DevTools Panel UX Improvements**
9
+
10
+ ### Added
11
+ - **Close Button on DevTools Panel** - Added X button in panel header to unload DevTools
12
+ - Located next to drag handle for easy access
13
+ - Hover effect (gray → red) for clear visual feedback
14
+ - Calls `disableDevPanel()` to completely unload the panel
15
+ - Logs panel closure using `devtools-ui` component
16
+
17
+ ### Changed
18
+ - **DevTools Toggle Button Text** - Improved button labels to be action-oriented
19
+ - Unloaded state: "Click to load DevTools" (was "✕ DevTools Unloaded")
20
+ - Loaded state: "Click to unload DevTools" (was "✓ DevTools Loaded")
21
+ - Clearer indication of what action will occur on click
22
+
23
+ ### Fixed
24
+ - **Button State Synchronization** - Fixed DevTools toggle button getting out of sync
25
+ - Added `jsg-devtools-destroyed` custom event dispatched when panel is destroyed
26
+ - App component listens for event to update button state automatically
27
+ - Button state now stays in sync whether panel is closed via X button or toggle button
28
+ - Uses event-driven architecture matching existing `devtoolschange` pattern
29
+
30
+ ### Technical Details
31
+ - **Files Modified**: `devtools/src/components/FloatingButton.jsx`, `devtools/src/components/DevToolsPanel.jsx`, `devtools/src/panel-entry.jsx`, `devtools/src/App.jsx`
32
+ - **Event System**: Custom event `jsg-devtools-destroyed` dispatched on panel destruction (both animation and immediate paths)
33
+ - **Result**: Improved UX with clear close action and reliable state synchronization
34
+
35
+ ## [1.7.4] - 2025-11-06 🎛️ **DevTools Logging Cleanup**
36
+
37
+ ### Fixed
38
+ - **Meta-Logger Scope** - Clarified meta-logger is for bootstrap logs only
39
+ - Removed `'logger'` mode option (now just `true`/`false`)
40
+ - Updated JSDoc to emphasize "BOOTSTRAP ONLY" usage
41
+ - Post-init errors now use actual logger if available, fallback to console
42
+ - **DevTools Component-Based Logging** - Fixed DevTools to use proper component logging
43
+ - Added `devtools-ui` component to `COMPONENT_SCHEME` (🎛️ emoji, purple color)
44
+ - DevTools controls API (`enableDevPanel`, `disableDevPanel`) now use `devtools-ui` component instead of `core`
45
+ - All DevTools files now import logger directly instead of using window globals
46
+ - Removed manual `[JSG-DEVTOOLS]` prefixes from all log messages (logger adds component name automatically)
47
+ - DevTools logs now show as `🎛️ [DEVTOOLS]` instead of `🎯 [CORE] [JSG-LOGGER]`
48
+
49
+ ### Changed
50
+ - **DevTools Logging Pattern** - Standardized DevTools logging approach
51
+ - Pattern: `import logger from '../../index.js'; const devtoolsLogger = logger.getComponent('devtools-ui');`
52
+ - No console fallbacks needed (`getComponent` always returns valid logger)
53
+ - Clean component-based logging throughout DevTools lifecycle
54
+
55
+ ### Technical Details
56
+ - **Files Modified**: `utils/meta-logger.js`, `index.js`, `config/config-manager.js`, `config/component-schemes.js`
57
+ - **DevTools Files**: `devtools/src/panel-entry.jsx`, `devtools/src/App.jsx`, `devtools/components/GlobalControls.js`, `devtools/components/DevToolsPanel.js`
58
+ - **Result**: Consistent, component-based logging with proper formatting and no manual prefixes
59
+
8
60
  ## [1.7.0] - 2025-01-XX 🎯 **Config-Driven Tree-Shaking & Enhanced Logging**
9
61
 
10
62
  ### Added
@@ -16,7 +16,8 @@ export const COMPONENT_SCHEME = {
16
16
  'websocket': { emoji: '🔗', color: '#1ABC9C', name: 'WEBSOCKET' },
17
17
  'notification': { emoji: '🔔', color: '#E74C3C', name: 'NOTIFICATION' },
18
18
  'router': { emoji: '🛣️', color: '#3498DB', name: 'ROUTER' },
19
- 'cache': { emoji: '💨', color: '#95A5A6', name: 'CACHE' }
19
+ 'cache': { emoji: '💨', color: '#95A5A6', name: 'CACHE' },
20
+ 'devtools-ui': { emoji: '🎛️', color: '#8E44AD', name: 'DEVTOOLS' }
20
21
  };
21
22
 
22
23
  export const LEVEL_SCHEME = {
@@ -6,6 +6,7 @@
6
6
 
7
7
  import defaultConfig from './default-config.json' with { type: 'json' };
8
8
  import {COMPONENT_SCHEME, LEVEL_SCHEME} from './component-schemes.js';
9
+ import {metaLog} from '../utils/meta-logger.js';
9
10
 
10
11
  export class ConfigManager {
11
12
  constructor() {
@@ -25,11 +26,11 @@ export class ConfigManager {
25
26
 
26
27
  if (typeof configSource === 'string') {
27
28
  // Load from file path - handle all path formats
28
- console.log(`[JSG-LOGGER] Loading config from file: ${configSource}`);
29
+ metaLog(`[JSG-LOGGER] Loading config from file: ${configSource}`);
29
30
  externalConfig = await this._loadConfigFromPath(configSource);
30
31
  } else if (typeof configSource === 'object') {
31
32
  // Direct config object
32
- console.log('[JSG-LOGGER] Loading inline config object:', Object.keys(configSource));
33
+ metaLog('[JSG-LOGGER] Loading inline config object:', Object.keys(configSource));
33
34
  externalConfig = configSource;
34
35
  }
35
36
 
@@ -46,17 +47,17 @@ export class ConfigManager {
46
47
  // Log devtools activation status
47
48
  const finalDevtoolsEnabled = this.config.devtools?.enabled ?? false;
48
49
  if (finalDevtoolsEnabled !== devtoolsBefore) {
49
- console.log(`[JSG-LOGGER] DevTools ${finalDevtoolsEnabled ? 'ENABLED' : 'DISABLED'} via user config (was ${devtoolsBefore ? 'enabled' : 'disabled'} in defaults)`);
50
+ metaLog(`[JSG-LOGGER] DevTools ${finalDevtoolsEnabled ? 'ENABLED' : 'DISABLED'} via user config (was ${devtoolsBefore ? 'enabled' : 'disabled'} in defaults)`);
50
51
  if (finalDevtoolsEnabled) {
51
- console.log('[JSG-LOGGER] DevTools will be available when enableDevPanel() is called');
52
+ metaLog('[JSG-LOGGER] DevTools will be available when enableDevPanel() is called');
52
53
  }
53
54
  } else {
54
- console.log(`[JSG-LOGGER] DevTools status: ${finalDevtoolsEnabled ? 'ENABLED' : 'DISABLED'} (using default config)`);
55
+ metaLog(`[JSG-LOGGER] DevTools status: ${finalDevtoolsEnabled ? 'ENABLED' : 'DISABLED'} (using default config)`);
55
56
  }
56
57
 
57
58
  return this.config;
58
59
  } catch (error) {
59
- console.error('ConfigManager: Error loading configuration:', error);
60
+ metaError('ConfigManager: Error loading configuration:', error);
60
61
  return this.config; // Return default config on error
61
62
  }
62
63
  }
@@ -92,14 +93,14 @@ export class ConfigManager {
92
93
 
93
94
  if (config) {
94
95
  this.loadedPaths.push(configPath);
95
- console.log(`[JSG-LOGGER] Successfully loaded config from: ${configPath}`);
96
+ metaLog(`[JSG-LOGGER] Successfully loaded config from: ${configPath}`);
96
97
  return config;
97
98
  } else {
98
- console.warn(`[JSG-LOGGER] Could not load config from: ${configPath} - using defaults`);
99
+ metaLog(`[JSG-LOGGER] Could not load config from: ${configPath} - using defaults`);
99
100
  return {};
100
101
  }
101
102
  } catch (error) {
102
- console.warn(`[JSG-LOGGER] Failed to load config from ${configPath}:`, error.message);
103
+ metaLog(`[JSG-LOGGER] Failed to load config from ${configPath}:`, error.message);
103
104
  return {};
104
105
  }
105
106
  }
@@ -199,7 +200,7 @@ export class ConfigManager {
199
200
  if (config.environments) {
200
201
  // For now, just log that environment configs exist
201
202
  // TODO: Implement environment-based config selection
202
- console.log(`[JSG-LOGGER] Found environment configs for: ${Object.keys(config.environments).join(', ')}`);
203
+ metaLog(`[JSG-LOGGER] Found environment configs for: ${Object.keys(config.environments).join(', ')}`);
203
204
  }
204
205
 
205
206
  // Normalize component configurations
@@ -2,6 +2,7 @@
2
2
  "projectName": "JSG Logger",
3
3
  "globalLevel": "info",
4
4
  "autoRegister": true,
5
+ "metaLogging": true,
5
6
  "format": {
6
7
  "style": "brackets",
7
8
  "componentCase": "upper",
@@ -0,0 +1,5 @@
1
+ const __viteBrowserExternal = {};
2
+ export {
3
+ __viteBrowserExternal as default
4
+ };
5
+ //# sourceMappingURL=__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__vite-browser-external-2Ng8QIWW-2Ng8QIWW.js","sources":["__vite-browser-external-2Ng8QIWW.js"],"sourcesContent":["const __viteBrowserExternal = {};\nexport {\n __viteBrowserExternal as default\n};\n//# sourceMappingURL=__vite-browser-external-2Ng8QIWW.js.map\n"],"names":[],"mappings":"AAAK,MAAC,wBAAwB,CAAA;"}
@@ -0,0 +1,5 @@
1
+ const __viteBrowserExternal = {};
2
+ export {
3
+ __viteBrowserExternal as default
4
+ };
5
+ //# sourceMappingURL=__vite-browser-external-2Ng8QIWW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__vite-browser-external-2Ng8QIWW.js","sources":["../__vite-browser-external"],"sourcesContent":["export default {}"],"names":[],"mappings":"AAAA,MAAA,wBAAe,CAAA;"}