private void generateFiveRandomTracesPerSecond ( ) { logGeneratorThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { while ( continueReading ) { int traceLevel = traceCounter % 6 ; switch ( traceLevel ) { case 0 : Log . d ( "Lynx" , traceCounter + " - Debug trace generated automatically" ) ; break ; case 1 : Log . w ( "Lynx" , traceCounter + " - Warning trace generated automatically" ) ; break ; case 2 : Log . e ( "Lynx" , traceCounter + " - Error trace generated automatically" ) ; break ; case 3 : Log . wtf ( "Lynx" , traceCounter + " - WTF trace generated automatically" ) ; break ; case 4 : Log . i ( "Lynx" , traceCounter + " - Info trace generated automatically" ) ; default : Log . v ( "Lynx" , traceCounter + " - Verbose trace generated automatically" ) ; } traceCounter ++ ; try { Thread . sleep ( 200 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } } ) ; logGeneratorThread . start ( ) ; }
Random traces generator used just for this demo application .