public static String print ( int priority , String tag , String msg , Throwable tr , boolean addTimestamp ) { // Compute the letter for the given priority String p = "X" ; // X => Unknown switch ( priority ) { case Constants . DEBUG : p = "D" ; break ; case Constants . INFO : p = "I" ; break ; case Constants . WARN : p = "W" ; break ; case Constants . ERROR : p = "E" ; break ; case Constants . ASSERT : p = "F" ; break ; } CharSequence timestamp = addTimestamp ? new SimpleDateFormat ( TIMESTAMP_PATTERN ) . format ( new Date ( ) ) : "" ; String base = p + "/" + timestamp + tag + ": " + msg ; return tr == null ? base : base + "\n" + getStackTraceString ( tr ) ; }
Gets a String form of the log data .