mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
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
This commit is contained in:
committed by
GitHub
parent
175eef5376
commit
db2d8aaa7e
29
apps/desktop/native-messaging-test-runner/src/log-utils.ts
Normal file
29
apps/desktop/native-messaging-test-runner/src/log-utils.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/* 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`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user