Update debugging

- Uniform client name
This commit is contained in:
Logan Cusano
2023-04-30 03:29:38 -04:00
parent 546d9e8829
commit b248e7f40e
9 changed files with 25 additions and 17 deletions

View File

@@ -12,6 +12,11 @@ exports.DebugBuilder = class DebugBuilder {
this.INFO = debug(`${appName}:${fileName}:INFO`);
this.DEBUG = debug(`${appName}:${fileName}:DEBUG`);
this.WARN = debug(`${appName}:${fileName}:WARNING`);
this.ERROR = debug(`${appName}:${fileName}:ERROR`);
this.VERBOSE = debug(`${appName}:${fileName}:VERBOSE`);
this.ERROR = (...messageParts) => {
const error = debug(`${appName}:${fileName}:ERROR`);
error(messageParts);
if (process.env.EXIT_ON_ERROR && process.env.EXIT_ON_ERROR > 0) setTimeout(process.exit, process.env.EXIT_ON_ERROR_DELAY ?? 0);
}
}
}