Exemplo n.º 1
0
  @SuppressWarnings({"StringConcatenationInsideStringBufferAppend"})
  private static String formatMessage(Exception e, Object message, Object[] args) {
    StringBuilder sb = new StringBuilder();

    if (message != null) sb.append(message.toString());

    if (e != null) sb.append((sb.length() > 0 ? "\n" : "") + e.toString());

    for (Object o : args) {
      if (o != null) sb.append((sb.length() > 0 ? "\n" : "") + o.toString());
    }

    return sb.toString();
  }