@crimsonsunset/jsg-logger 1.7.2 → 1.7.4
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 +25 -0
- package/config/component-schemes.js +2 -1
- package/config/config-manager.js +11 -10
- package/config/default-config.json +1 -0
- package/devtools/dist/__vite-browser-external-2Ng8QIWW.js +5 -0
- package/devtools/dist/__vite-browser-external-2Ng8QIWW.js.map +1 -0
- package/devtools/dist/panel-entry-DzGsV7s-.js +11418 -0
- package/devtools/dist/panel-entry-DzGsV7s-.js.map +1 -0
- package/devtools/dist/panel-entry.js +2273 -88
- package/devtools/dist/panel-entry.js.map +1 -1
- package/index.js +50 -96
- package/package.json +1 -1
- package/utils/meta-logger.js +80 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ 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.3] - 2025-11-06 🎛️ **DevTools Logging Cleanup**
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Meta-Logger Scope** - Clarified meta-logger is for bootstrap logs only
|
|
12
|
+
- Removed `'logger'` mode option (now just `true`/`false`)
|
|
13
|
+
- Updated JSDoc to emphasize "BOOTSTRAP ONLY" usage
|
|
14
|
+
- Post-init errors now use actual logger if available, fallback to console
|
|
15
|
+
- **DevTools Component-Based Logging** - Fixed DevTools to use proper component logging
|
|
16
|
+
- Added `devtools-ui` component to `COMPONENT_SCHEME` (🎛️ emoji, purple color)
|
|
17
|
+
- DevTools controls API (`enableDevPanel`, `disableDevPanel`) now use `devtools-ui` component instead of `core`
|
|
18
|
+
- All DevTools files now import logger directly instead of using window globals
|
|
19
|
+
- Removed manual `[JSG-DEVTOOLS]` prefixes from all log messages (logger adds component name automatically)
|
|
20
|
+
- DevTools logs now show as `🎛️ [DEVTOOLS]` instead of `🎯 [CORE] [JSG-LOGGER]`
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- **DevTools Logging Pattern** - Standardized DevTools logging approach
|
|
24
|
+
- Pattern: `import logger from '../../index.js'; const devtoolsLogger = logger.getComponent('devtools-ui');`
|
|
25
|
+
- No console fallbacks needed (`getComponent` always returns valid logger)
|
|
26
|
+
- Clean component-based logging throughout DevTools lifecycle
|
|
27
|
+
|
|
28
|
+
### Technical Details
|
|
29
|
+
- **Files Modified**: `utils/meta-logger.js`, `index.js`, `config/config-manager.js`, `config/component-schemes.js`
|
|
30
|
+
- **DevTools Files**: `devtools/src/panel-entry.jsx`, `devtools/src/App.jsx`, `devtools/components/GlobalControls.js`, `devtools/components/DevToolsPanel.js`
|
|
31
|
+
- **Result**: Consistent, component-based logging with proper formatting and no manual prefixes
|
|
32
|
+
|
|
8
33
|
## [1.7.0] - 2025-01-XX 🎯 **Config-Driven Tree-Shaking & Enhanced Logging**
|
|
9
34
|
|
|
10
35
|
### 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 = {
|
package/config/config-manager.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
50
|
+
metaLog(`[JSG-LOGGER] DevTools ${finalDevtoolsEnabled ? 'ENABLED' : 'DISABLED'} via user config (was ${devtoolsBefore ? 'enabled' : 'disabled'} in defaults)`);
|
|
50
51
|
if (finalDevtoolsEnabled) {
|
|
51
|
-
|
|
52
|
+
metaLog('[JSG-LOGGER] DevTools will be available when enableDevPanel() is called');
|
|
52
53
|
}
|
|
53
54
|
} else {
|
|
54
|
-
|
|
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
|
-
|
|
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
|
-
|
|
96
|
+
metaLog(`[JSG-LOGGER] Successfully loaded config from: ${configPath}`);
|
|
96
97
|
return config;
|
|
97
98
|
} else {
|
|
98
|
-
|
|
99
|
+
metaLog(`[JSG-LOGGER] Could not load config from: ${configPath} - using defaults`);
|
|
99
100
|
return {};
|
|
100
101
|
}
|
|
101
102
|
} catch (error) {
|
|
102
|
-
|
|
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
|
-
|
|
203
|
+
metaLog(`[JSG-LOGGER] Found environment configs for: ${Object.keys(config.environments).join(', ')}`);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
// Normalize component configurations
|
|
@@ -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;"}
|