keystone-design-bootstrap 1.0.97 → 1.0.98

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.
@@ -30,6 +30,7 @@ type OTelInitOptions = {
30
30
  let otelProvider: LoggerProvider | null = null;
31
31
  let otelLogger: ReturnType<typeof logs.getLogger> | null = null;
32
32
  let otelInitFingerprint = '';
33
+ const browserConsole = globalThis?.['console'];
33
34
 
34
35
  /**
35
36
  * Channel → accent colour. Unregistered channels fall through to gray.
@@ -167,14 +168,14 @@ function emitConsole(
167
168
  const detailStyle = 'color:#999; font-weight:normal';
168
169
 
169
170
  if (level === 'error') {
170
- console.error(message, channelStyle, eventStyle, detailStyle);
171
+ browserConsole?.error?.(message, channelStyle, eventStyle, detailStyle);
171
172
  return;
172
173
  }
173
174
  if (level === 'warn') {
174
- console.warn(message, channelStyle, eventStyle, detailStyle);
175
+ browserConsole?.warn?.(message, channelStyle, eventStyle, detailStyle);
175
176
  return;
176
177
  }
177
- console.log(message, channelStyle, eventStyle, detailStyle);
178
+ browserConsole?.log?.(message, channelStyle, eventStyle, detailStyle);
178
179
  }
179
180
 
180
181
  function emitToPostHog(level: LogLevel, channel: string, event: string, detail: Record<string, unknown>): void {