@@ -8,7 +8,9 @@ import fps = require("fps-meter");
88
99export function createPage ( ) {
1010 fps . addCallback ( function ( fps , minFps ) {
11- trace . write ( "fps=" + fps + " minFps=" + minFps , trace . categories . Test , trace . messageType . info ) ;
11+ if ( trace . enabled ) {
12+ trace . write ( "fps=" + fps + " minFps=" + minFps , trace . categories . Test , trace . messageType . info ) ;
13+ }
1214 } ) ;
1315 fps . start ( ) ;
1416
@@ -27,7 +29,9 @@ export function createPage() {
2729 var button ;
2830 var childStackLayout ;
2931 var childStackLayoutCount = count / buttonsPerRow ;
30- trace . write ( "Creating " + count + " buttons." , trace . categories . Test , trace . messageType . info ) ;
32+ if ( trace . enabled ) {
33+ trace . write ( "Creating " + count + " buttons." , trace . categories . Test , trace . messageType . info ) ;
34+ }
3135 console . time ( "creatingButtons" ) ;
3236 for ( var i = 0 ; i < childStackLayoutCount ; i ++ ) {
3337 childStackLayout = new stackLayoutModule . StackLayout ( ) ;
@@ -36,15 +40,19 @@ export function createPage() {
3640 for ( var j = 0 ; j < buttonsPerRow ; j ++ ) {
3741 button = new buttonModule . Button ( ) ;
3842 button . on ( buttonModule . Button . tapEvent , function ( data ) {
39- trace . write ( "eventName=" + data . eventName + " object=" + data . object , trace . categories . Test , trace . messageType . info ) ;
43+ if ( trace . enabled ) {
44+ trace . write ( "eventName=" + data . eventName + " object=" + data . object , trace . categories . Test , trace . messageType . info ) ;
45+ }
4046 } ) ;
4147 button . text = "" + i + j ;
4248 childStackLayout . addChild ( button ) ;
4349 }
4450 }
4551 console . timeEnd ( "creatingButtons" ) ;
4652 var message = "Created " + count + " buttons" ;
47- trace . write ( message , trace . categories . Test , trace . messageType . info ) ;
53+ if ( trace . enabled ) {
54+ trace . write ( message , trace . categories . Test , trace . messageType . info ) ;
55+ }
4856 label . text = message ;
4957
5058 var page = new pagesModule . Page ( ) ;
0 commit comments