rust/editors/code/src/util.ts

19 lines
525 B
TypeScript
Raw Normal View History

2020-02-21 08:59:46 -06:00
let enabled: boolean = false;
export const log = {
debug(message?: any, ...optionalParams: any[]): void {
if (!enabled) return;
// eslint-disable-next-line no-console
console.log(message, ...optionalParams);
},
error(message?: any, ...optionalParams: any[]): void {
if (!enabled) return;
debugger;
// eslint-disable-next-line no-console
console.error(message, ...optionalParams);
},
setEnabled(yes: boolean): void {
enabled = yes;
}
};