website refactor
This commit is contained in:
@@ -36,6 +36,7 @@ export class ConsoleLogger implements Logger {
|
||||
const color = this.COLORS[level];
|
||||
const emoji = this.EMOJIS[level];
|
||||
const prefix = this.PREFIXES[level];
|
||||
const timestamp = new Date().toISOString();
|
||||
|
||||
// Edge runtime doesn't support console.groupCollapsed/groupEnd
|
||||
// Fallback to simple logging for compatibility
|
||||
@@ -44,13 +45,13 @@ export class ConsoleLogger implements Logger {
|
||||
if (supportsGrouping) {
|
||||
// Safe to call - we've verified both functions exist
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(console as any).groupCollapsed(`%c${emoji} [${source.toUpperCase()}] ${prefix}: ${message}`, `color: ${color}; font-weight: bold;`);
|
||||
(console as any).groupCollapsed(`%c${emoji} [${timestamp}] [${source.toUpperCase()}] ${prefix}: ${message}`, `color: ${color}; font-weight: bold;`);
|
||||
} else {
|
||||
// Simple format for edge runtime
|
||||
console.log(`${emoji} [${source.toUpperCase()}] ${prefix}: ${message}`);
|
||||
console.log(`${emoji} [${timestamp}] [${source.toUpperCase()}] ${prefix}: ${message}`);
|
||||
}
|
||||
|
||||
console.log(`%cTimestamp:`, 'color: #666; font-weight: bold;', new Date().toISOString());
|
||||
console.log(`%cTimestamp:`, 'color: #666; font-weight: bold;', timestamp);
|
||||
console.log(`%cSource:`, 'color: #666; font-weight: bold;', source);
|
||||
|
||||
if (context) {
|
||||
|
||||
Reference in New Issue
Block a user