private static void printKeyValue(Appendable out, String key, Object value) throws IOException { boolean bold = key.startsWith("!"); if (bold) { key = key.substring(1); } if (key.equalsIgnoreCase("password") || key.endsWith("password")) { if (value instanceof String) { if (U.notEmpty((String) value)) { value = "*****"; } } } out.append(" | "); out.append(key); out.append(" = "); appendFancy(out, value, bold); if (value instanceof Throwable) { Throwable err = (Throwable) value; if (options.stackTraceOnStdErr()) { err.printStackTrace(); } else { ByteArrayOutputStream stream = new ByteArrayOutputStream(); err.printStackTrace(new PrintStream(stream)); out.append("\n"); out.append(stream.toString()); } } }
msg = msg.substring(1); appendFancy(out, msg, bold);
private static void printKeyValue(Appendable out, String key, Object value) throws IOException { boolean bold = key.startsWith("!"); if (bold) { key = key.substring(1); } if (key.equalsIgnoreCase("password") || key.endsWith("password")) { if (value instanceof String) { if (U.notEmpty((String) value)) { value = "*****"; } } } out.append(" | "); out.append(key); out.append(" = "); appendFancy(out, value, bold); if (value instanceof Throwable) { Throwable err = (Throwable) value; if (options.stackTraceOnStdErr()) { err.printStackTrace(); } else { ByteArrayOutputStream stream = new ByteArrayOutputStream(); err.printStackTrace(new PrintStream(stream)); out.append("\n"); out.append(stream.toString()); } } }
msg = msg.substring(1); appendFancy(out, msg, bold);