@@ -0,0 +1,1094 @@
+package com.hunantv.fw.log;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport com.hunantv.fw.utils.SeqID;%0A%0Apublic class LogData %7B%0A%0A%09private static ThreadLocal%3CLogData%3E local = new ThreadLocal%3CLogData%3E() %7B%0A%09%09@Override%0A%09%09protected LogData initialValue() %7B%0A%09%09%09return new LogData();%0A%09%09%7D%0A%09%7D;%0A%0A%09private String id;%0A%09private List%3CString%3E data;%0A%0A%09public static LogData instance() %7B%0A%09%09return local.get();%0A%09%7D%0A%0A%09private LogData() %7B%0A%09%09this.id = SeqID.rnd().toString();%0A%09%09this.data = new ArrayList%3CString%3E();%0A%09%7D%0A%0A%09public List%3CString%3E getData() %7B%0A%09%09return this.data;%0A%09%7D%0A%0A%09public String getId() %7B%0A%09%09return local.get().id;%0A%09%7D%0A%0A%09public void setId(String id) %7B%0A%09%09local.get().id = id;%0A%09%7D%0A%0A%09public void add(String key, String value) %7B%0A%09%09local.get().data.add(key + %22=%22 + value);%0A%09%7D%0A%0A%09public void clear() %7B%0A%09%09local.remove();%0A%09%7D%0A%0A%09public String toString() %7B%0A%09%09List%3CString%3E d = local.get().data;%0A%09%09if (d.size() == 0)%0A%09%09%09return %22%22;%0A%09%09StringBuilder strb = new StringBuilder();%0A%09%09strb.append(%22%5B %22);%0A%09%09for (String ele : d) %7B%0A%09%09%09strb.append(ele).append(%22 %22);%0A%09%09%7D%0A%09%09strb.append(%22%5D%22);%0A%09%09return strb.toString();%0A%09%7D%0A%7D%0A

重构代码，修复bug