prepend "Karousel:" to logs

This commit is contained in:
Peter Fajdiga
2023-09-01 21:17:11 +02:00
parent a3f479e2e6
commit a5ecc94479
3 changed files with 6 additions and 3 deletions

View File

@@ -20,8 +20,8 @@ function catchWrap(f: () => void) {
try {
f();
} catch (error: any) {
console.log(error);
console.log(error.stack);
log(error);
log(error.stack);
}
};
}

3
src/utils/log.ts Normal file
View File

@@ -0,0 +1,3 @@
function log(...args: any[]) {
console.log("Karousel:", ...args);
}

View File

@@ -16,7 +16,7 @@ class ClientManager {
parsedWindowRules = JSON.parse(config.windowRules);
} catch (error: any) {
notificationInvalidWindowRules.sendEvent();
console.log("failed to parse windowRules:", error);
log("failed to parse windowRules:", error);
}
this.windowRuleEnforcer = new WindowRuleEnforcer(parsedWindowRules);
}