code: public static String stacktraceToString(Throwable throwable, int limit, Map<Character, String> replaceCharToStrMap) {
  		final FastByteArrayOutputStream baos = new FastByteArrayOutputStream();
  		throwable.printStackTrace(new PrintStream(baos));
  		String exceptionStr = baos.toString();
  		int length = exceptionStr.length();
  		if (limit > 0 && limit < length) {
  			length = limit;
  		}
  
  		if (CollectionUtil.isNotEmpty(replaceCharToStrMap)) {
  			final StringBuilder sb = StrUtil.builder();
  			char c;
  			String value;
  			for (int i = 0; i < length; i++) {
  				c = exceptionStr.charAt(i);
  				value = replaceCharToStrMap.get(c);
  				if (null != value) {
  					sb.append(value);
  				} else {
  					sb.append(c);
  				}
  			}
  			return sb.toString();
  		} else {
  			return StrUtil.subPre(exceptionStr, limit);
  		}
  	}
docs: 堆栈转为完整字符串
  
  @param throwable 异常对象
  @param limit 限制最大长度
  @param replaceCharToStrMap 替换字符为指定字符串
  @return 堆栈转为的字符串