improve logging

This commit is contained in:
2025-07-01 20:23:04 +02:00
parent 317f4d7fba
commit a8b6a309f0
2 changed files with 10 additions and 3 deletions

View File

@ -12,7 +12,7 @@ export const log = {
console.debug(new Date().toISOString(), ...params);
},
debug: (...params: any[]) => {
if (!DEV) {
if (!log.isDebugEnabled()) {
return;
}
console.debug(new Date().toISOString(), ...params);
@ -28,5 +28,8 @@ export const log = {
},
error: (...params: any[]) => {
console.error(new Date().toISOString(), ...params);
},
isDebugEnabled: (): boolean => {
return DEV;
}
};