GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Removes console functions in production environments

parent a393f33d
......@@ -172,5 +172,17 @@ const appRoutes: Routes = [
bootstrap: [RootComponent],
})
export class RootModule {
constructor() {}
constructor() {
if (environment.production) {
const console: any = {};
console.log = function (): void {};
// tslint:disable-next-line:no-console
console.info = function (): void {};
// tslint:disable-next-line:no-console
console.trace = function (): void {};
console.warn = function (): void {};
console.error = window.console.error;
(window as any).console = console;
}
}
}
......@@ -68,11 +68,6 @@ export class RootComponent implements OnInit, AfterViewInit {
this.sharedService.isLoadingEmitter.pipe(takeUntil(this._destroy)).subscribe(isLoading => {
setTimeout(() => this.isLoading = isLoading);
});
if (environment.production) {
console.log = () => {};
console.warn = () => {};
}
}
public ngOnInit(): void {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment