The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/app/e2e/client/logger.ts

19 lines
544 B

import { getConfig } from '../../../client/lib/utils/getConfig';
let debug: boolean | undefined = undefined;
const isDebugEnabled = (): boolean => {
if (debug === undefined) {
debug = getConfig('debug') === 'true' || getConfig('debug-e2e') === 'true';
}
return debug;
};
export const log = (context: string, ...msg: unknown[]): void => {
isDebugEnabled() && console.log(`[${context}]`, ...msg);
};
export const logError = (context: string, ...msg: unknown[]): void => {
isDebugEnabled() && console.error(`[${context}]`, ...msg);
};