/** 对象组转字符串 */ public static string objectsToString(object[] objs) { if (objs.Length == 0) { return(""); } if (objs.Length == 1) { if (objs[0] == null) { return("null"); } else { return(objs[0].ToString()); } } StringBuilder sb = StringBuilderPool.createForThread(); writeObjectsToStringBuilder(sb, objs); return(StringBuilderPool.releaseStrForThread(sb)); }
private static String exceptionToString(string str, Exception e) { StringBuilder sb = StringBuilderPool.createForThread(); writeExceptionToString(sb, str, e); return(StringBuilderPool.releaseStrForThread(sb)); }
public static void toThrowError(StringBuilder sb, Exception e) { if (sb.Length > 0) { sb.Append("\n"); } if (e != null) { sb.Append(e.Message); sb.Append("\n"); } else { e = new Exception(sb.ToString()); } string es = null; if (ShineSetting.needError) { es = sb.ToString(); } sb.Append(stackTraceToString(e)); sb.Append("\n"); string str = StringBuilderPool.releaseStrForThread(sb); toLog(str, SLogType.Error); if (ShineSetting.needError) { throw new Exception(es); } }