question: private static synchronized void appendMessage ( Context c , final String msg ) { if ( msg . length ( ) == 0 ) return ; String out = msg ; boolean timestamp = PrefStore . isTimestamp ( c ) ; int maxLines = PrefStore . getMaxLines ( c ) ; int protocolSize = protocol . size ( ) ; if ( protocolSize > 0 && lastChar != '\n' ) { protocol . remove ( protocolSize - 1 ) ; out = lastLine + out ; } lastChar = out . charAt ( out . length ( ) - 1 ) ; String [ ] lines = out . split ( "\\n" ) ; for ( int i = 0 , l = lines . length ; i < l ; i ++ ) { lastLine = lines [ i ] ; if ( timestamp ) protocol . add ( getTimeStamp ( ) + lastLine ) ; else protocol . add ( lastLine ) ; if ( protocolSize + i >= maxLines ) { protocol . remove ( 0 ) ; } } show ( ) ; if ( PrefStore . isLogger ( c ) ) write ( c , msg ) ; }
target:  Append the message to protocol and show