mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 06:31:12 -05:00
feat: Implement Phase 5 optimization and best practices
This commit is contained in:
20
src/lib/logger.ts
Normal file
20
src/lib/logger.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Logger Utility
|
||||
*
|
||||
* Provides conditional logging based on environment.
|
||||
* Prevents console noise in production builds.
|
||||
*/
|
||||
|
||||
const isDev = import.meta.env.DEV;
|
||||
|
||||
export const logger = {
|
||||
log: (...args: any[]) => {
|
||||
if (isDev) console.log(...args);
|
||||
},
|
||||
error: (...args: any[]) => {
|
||||
console.error(...args); // Always log errors
|
||||
},
|
||||
warn: (...args: any[]) => {
|
||||
if (isDev) console.warn(...args);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user