Skip to content

Commit 94cde33

Browse files
committed
Fix ExceptionHandler logger (squash)
1 parent 2006d47 commit 94cde33

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/nativescript-angular/application.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "zone.js/dist/zone-node"
44

55
import 'reflect-metadata';
66
import './polyfills/array';
7-
import {isPresent, Type} from '@angular/core/src/facade/lang';
7+
import {isPresent, Type, print} from '@angular/core/src/facade/lang';
88
import {ReflectiveInjector, reflector, coreLoadAndBootstrap, createPlatform,
99
getPlatform, assertPlatform, ComponentRef, PlatformRef, PLATFORM_DIRECTIVES, PLATFORM_PIPES} from '@angular/core';
1010
import {bind, provide, Provider} from '@angular/core/src/di';
@@ -38,6 +38,13 @@ export interface AppOptions {
3838
startPageActionBarHidden?: boolean;
3939
}
4040

41+
class ConsoleLogger {
42+
log = print;
43+
logError = print;
44+
logGroup = print;
45+
logGroupEnd() {}
46+
}
47+
4148
export function bootstrap(appComponentType: any,
4249
customProviders: ProviderArray = null): Promise<ComponentRef> {
4350
NativeScriptDomAdapter.makeCurrent();
@@ -52,7 +59,9 @@ export function bootstrap(appComponentType: any,
5259
provide(PLATFORM_PIPES, { useValue: COMMON_PIPES, multi: true }),
5360
provide(PLATFORM_DIRECTIVES, { useValue: COMMON_DIRECTIVES, multi: true }),
5461
provide(PLATFORM_DIRECTIVES, { useValue: NS_DIRECTIVES, multi: true }),
55-
provide(ExceptionHandler, { useFactory: () => new ExceptionHandler(null, true), deps: [] }),
62+
provide(ExceptionHandler, { useFactory: () => {
63+
return new ExceptionHandler(new ConsoleLogger(), true)
64+
}, deps: [] }),
5665

5766
defaultPageProvider,
5867
defaultDeviceProvider,

0 commit comments

Comments
 (0)