@crimsonsunset/jsg-logger 1.7.6 → 1.7.8

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.
@@ -166,20 +166,7 @@ function extractContextData(logData) {
166
166
  function displayContextData(contextData) {
167
167
  Object.entries(contextData).forEach(([key, value]) => {
168
168
  if (typeof value === 'object' && value !== null) {
169
- // Check for circular references before logging
170
- try {
171
- // Try to stringify to detect circular references
172
- JSON.stringify(value);
173
- console.log(` ├─ %c${key}:`, 'color: #00C896; font-weight: bold;', value);
174
- } catch (error) {
175
- // Circular reference detected - log a safe representation
176
- if (error.message.includes('circular')) {
177
- console.log(` ├─ %c${key}:`, 'color: #00C896; font-weight: bold;', '[Circular Reference]', value);
178
- } else {
179
- // Other error - log the object directly (browser console can handle it)
180
169
  console.log(` ├─ %c${key}:`, 'color: #00C896; font-weight: bold;', value);
181
- }
182
- }
183
170
  } else {
184
171
  console.log(` ├─ %c${key}: %c${value}`, 'color: #00C896; font-weight: bold;', 'color: inherit;');
185
172
  }
package/index.d.ts CHANGED
@@ -80,6 +80,7 @@ export interface LoggerControls {
80
80
  getConfigSummary?: () => any;
81
81
  setComponentLevel?: (component: string, level: string) => void;
82
82
  getComponentLevel?: (component: string) => string | undefined;
83
+ getComponent?: (componentName: string) => any;
83
84
  enableDevPanel?: () => Promise<any>;
84
85
  disableDevPanel?: () => boolean;
85
86
  refresh?: () => void;
package/index.js CHANGED
@@ -27,7 +27,7 @@ if (defaultDevtoolsEnabled) {
27
27
  metaLog('[JSG-LOGGER] DevTools module pre-loading started (default config enabled)');
28
28
  // Start loading immediately but don't await (non-blocking)
29
29
  // Bundlers can still analyze this static import for tree-shaking
30
- devtoolsModulePromise = import('./devtools/dist/panel-entry.js').then(module => {
30
+ devtoolsModulePromise = import('@crimsonsunset/jsg-logger/devtools').then(module => {
31
31
  devtoolsModule = module;
32
32
  metaLog('[JSG-LOGGER] DevTools module pre-loaded successfully');
33
33
  return module;
@@ -498,6 +498,9 @@ class JSGLogger {
498
498
  return configManager.config.components?.[component]?.level;
499
499
  },
500
500
 
501
+ // Component logger access
502
+ getComponent: (componentName) => this.getComponent(componentName),
503
+
501
504
  // DevTools panel controls
502
505
  enableDevPanel: async () => {
503
506
  const devtoolsLogger = this.getComponent('devtools-ui');
@@ -531,7 +534,7 @@ class JSGLogger {
531
534
  // Runtime config override: consumer enabled devtools but default was disabled
532
535
  // Load on demand via dynamic import
533
536
  devtoolsLogger.info('Loading DevTools module dynamically (runtime config override)...');
534
- devtoolsModule = await import('./devtools/dist/panel-entry.js');
537
+ devtoolsModule = await import('@crimsonsunset/jsg-logger/devtools');
535
538
  }
536
539
  } else {
537
540
  devtoolsLogger.info('Using pre-loaded DevTools module');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crimsonsunset/jsg-logger",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "type": "module",
5
5
  "description": "Multi-environment logger with smart detection, file-level overrides, and beautiful console formatting. Test it live: https://logger.joesangiorgio.com/",
6
6
  "main": "index.js",