code: protected String format(Throwable throwable)
      {
          String text=null;
          if(throwable!=null)
          {
              //init writer
              StringWriter writer=new StringWriter(1500);
              
              //write throwable
              throwable.printStackTrace(new PrintWriter(writer));
              
              //get text
              text=writer.toString();
          }
          
          return text;
      }
docs: Converts the provided throwable to string.
  
  @param   throwable
  The throwable (may be null)
  @return  The string