mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-11 01:02:01 +03:00
🧹 [code health improvement] Conditionally execute console logs based on environment
Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
parent
bede889ced
commit
af04e9b997
1 changed files with 9 additions and 3 deletions
|
|
@ -1,5 +1,11 @@
|
|||
export const logger = {
|
||||
info: (...args: any[]) => console.info(...args),
|
||||
warn: (...args: any[]) => console.warn(...args),
|
||||
error: (...args: any[]) => console.error(...args),
|
||||
info: (...args: any[]) => {
|
||||
if (import.meta.env.DEV) console.info(...args);
|
||||
},
|
||||
warn: (...args: any[]) => {
|
||||
if (import.meta.env.DEV) console.warn(...args);
|
||||
},
|
||||
error: (...args: any[]) => {
|
||||
if (import.meta.env.DEV) console.error(...args);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue