@@ -249,7 +249,11 @@ export class Console implements definition.Console {
249
249
public assert ( test : boolean , message : string , ...formatParams : any [ ] ) : void {
250
250
if ( ! test ) {
251
251
Array . prototype . shift . apply ( arguments ) ;
252
- this . error ( this . formatParams . apply ( this , arguments ) ) ;
252
+ let formatedMessage = this . formatParams . apply ( this , arguments ) ;
253
+ this . error ( formatedMessage , trace . messageType . error ) ;
254
+ if ( global . __consoleMessage ) {
255
+ global . __consoleMessage ( formatedMessage , "error" ) ;
256
+ }
253
257
}
254
258
}
255
259
@@ -258,15 +262,27 @@ export class Console implements definition.Console {
258
262
}
259
263
260
264
public warn ( message : any , ...formatParams : any [ ] ) : void {
261
- this . logMessage ( this . formatParams . apply ( this , arguments ) , trace . messageType . warn ) ;
265
+ let formatedMessage = this . formatParams . apply ( this , arguments ) ;
266
+ this . logMessage ( formatedMessage , trace . messageType . warn ) ;
267
+ if ( global . __consoleMessage ) {
268
+ global . __consoleMessage ( formatedMessage , "warning" ) ;
269
+ }
262
270
}
263
271
264
272
public error ( message : any , ...formatParams : any [ ] ) : void {
265
- this . logMessage ( this . formatParams . apply ( this , arguments ) , trace . messageType . error ) ;
273
+ let formatedMessage = this . formatParams . apply ( this , arguments ) ;
274
+ this . logMessage ( formatedMessage , trace . messageType . error ) ;
275
+ if ( global . __consoleMessage ) {
276
+ global . __consoleMessage ( formatedMessage , "error" )
277
+ }
266
278
}
267
279
268
280
public log ( message : any , ...formatParams : any [ ] ) : void {
269
- this . logMessage ( this . formatParams . apply ( this , arguments ) , trace . messageType . log ) ;
281
+ let formatedMessage = this . formatParams . apply ( this , arguments ) ;
282
+ this . logMessage ( formatedMessage , trace . messageType . log ) ;
283
+ if ( global . __consoleMessage ) {
284
+ global . __consoleMessage ( formatedMessage , "log" )
285
+ }
270
286
}
271
287
272
288
private logMessage ( message : string , messageType : number ) : void {
0 commit comments