Hades
5 years ago
2 changed files with 80 additions and 0 deletions
@ -0,0 +1,43 @@
|
||||
package com.fr.design.mainframe.messagecollect; |
||||
|
||||
import com.fr.config.MarketConfig; |
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.mainframe.errorinfo.ErrorInfo; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
/** |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/1/8 |
||||
*/ |
||||
public class StartErrorMessageCollector { |
||||
|
||||
private static final StartErrorMessageCollector INSTANCE = new StartErrorMessageCollector(); |
||||
|
||||
private String uuid; |
||||
private String activeKey; |
||||
|
||||
|
||||
public static StartErrorMessageCollector getInstance() { |
||||
return INSTANCE; |
||||
} |
||||
|
||||
private StartErrorMessageCollector() { |
||||
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
||||
this.uuid = envManager.getUUID(); |
||||
this.activeKey = envManager.getActivationKey(); |
||||
} |
||||
|
||||
public void record(String id, String msg, String detail) { |
||||
ErrorInfo errorInfo = new ErrorInfo(StringUtils.EMPTY, uuid, activeKey); |
||||
errorInfo.setLogid(id); |
||||
errorInfo.setLog(msg); |
||||
errorInfo.setStackTrace(detail); |
||||
errorInfo.saveAsJSON(); |
||||
} |
||||
|
||||
public void record(String id, String msg) { |
||||
record(id, msg, StringUtils.EMPTY); |
||||
} |
||||
} |
@ -0,0 +1,37 @@
|
||||
package com.fr.design.mainframe.messagecollect.entity; |
||||
|
||||
import com.fr.design.i18n.Toolkit; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/1/8 |
||||
*/ |
||||
public enum DesignerErrorMessage { |
||||
|
||||
DESIGNER_PROCESS_OCCUPIED("11300201", Toolkit.i18nText("Fine-Design_Error_Process_Occupied_Message")), |
||||
PORT_OCCUPIED("11300202", Toolkit.i18nText("Fine-Design_Error_Port_Occupied_Message")), |
||||
FINEDB_PROBLEM("11300203", Toolkit.i18nText("Fine-Design_Error_Finedb_Problem_Message")), |
||||
DESIGNER_OUT_OF_MEMORY("11300204", Toolkit.i18nText("Fine-Design_Error_Out_Of_Memory_Message")), |
||||
REMOTE_DESIGN_NO_RESPONSE("11300205", Toolkit.i18nText("Fine-Design_Error_Remote_No_Response_Message")), |
||||
UNEXCEPTED_START_FAILED("11300200", Toolkit.i18nText("Fine-Design_Error_UnExcepted_Start_Failed")), |
||||
UNEXCEPTED_FALL_BACK("11300400 ", Toolkit.i18nText("Fine-Design_Error_UnExcepted_Fall_Back")); |
||||
|
||||
|
||||
|
||||
private String id; |
||||
private String message; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public String getMessage() { |
||||
return message; |
||||
} |
||||
|
||||
DesignerErrorMessage(String id, String message) { |
||||
this.id = id; |
||||
this.message = message; |
||||
} |
||||
} |
Loading…
Reference in new issue