All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.data.thread.util.QuickDataThreadUtil Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package cn.schoolwow.data.thread.util;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Map;

public class QuickDataThreadUtil {
    public static String formatThreadException(Map threadIdExceptionMap){
        StringBuilder builder = new StringBuilder("线程详细异常:\r\n");
        for(Map.Entry entry:threadIdExceptionMap.entrySet()){
            Exception exception = entry.getValue();
            builder.append(entry.getKey()+":"+exception2String(exception)+"\r\n");
        }
        return builder.toString();
    }

    public static String exception2String(Exception e) {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        return sw.toString();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy