mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01:00
db2d8aaa7e
Renamed folders: ./apps/desktop/src/models/nativeMessaging ./apps/desktop/src/models/nativeMessaging/encryptedMessagePayloads ./apps/desktop/src/models/nativeMessaging/encryptedMessageResponses Renamed all files Cleaned up entries in whitelist-capital-letters.txt
30 lines
857 B
TypeScript
30 lines
857 B
TypeScript
/* eslint-disable no-console */
|
|
|
|
// Class for logging messages with colors for ease of reading important info
|
|
// Reference: https://stackoverflow.com/a/41407246
|
|
export class LogUtils {
|
|
static logSuccess(message: string, payload?: any): void {
|
|
this.logFormat(message, "32", payload);
|
|
}
|
|
|
|
static logWarning(message: string, payload?: any): void {
|
|
this.logFormat(message, "33", payload);
|
|
}
|
|
|
|
static logError(message: string, payload?: any): void {
|
|
this.logFormat(message, "31", payload);
|
|
}
|
|
|
|
static logInfo(message: string, payload?: any): void {
|
|
this.logFormat(message, "36", payload);
|
|
}
|
|
|
|
private static logFormat(message: string, color: string, payload?: any) {
|
|
if (payload) {
|
|
console.log(`\x1b[${color}m ${message} \x1b[0m`, payload);
|
|
} else {
|
|
console.log(`\x1b[${color}m ${message} \x1b[0m`);
|
|
}
|
|
}
|
|
}
|