Browse Source

Pull request #7208: REPORT-64300 远程设计时日志推送问题

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit '33e1ac2dde3ffbf1e9de84286b76cde412e8b3a5':
  REPORT-64300 远程设计时日志推送问题
feature/x
Hades 3 years ago
parent
commit
34cf30ba1d
  1. 27
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

27
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java

@ -1,27 +0,0 @@
package com.fr.design.mainframe.loghandler;
import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.third.apache.logging.log4j.Level;
import com.fr.third.apache.logging.log4j.core.LogEvent;
import com.fr.third.apache.logging.log4j.core.impl.Log4jLogEvent;
import com.fr.third.apache.logging.log4j.message.SimpleMessage;
/**
* 兼容log4j1和2之间logEvent之间的转换
*
* @author hades
* @version 11.0
* Created by hades on 2021/12/9
*/
public class LogEventConverter {
public static LogEvent convert(LoggingEvent loggingEvent) {
SimpleMessage message = new SimpleMessage(loggingEvent.getRenderedMessage());
return Log4jLogEvent.newBuilder().
setMessage(message).
setLevel(Level.getLevel(loggingEvent.getLevel().toString())).
build();
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -11,7 +11,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogger; import com.fr.design.mainframe.loghandler.DesignerLogger;
import com.fr.design.mainframe.loghandler.LogEventConverter;
import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.share.ui.base.MouseClickListener;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil; import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.mainframe.toast.ToastMsgDialog;
@ -34,6 +33,7 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.server.socket.LogEventConverter;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
import io.socket.emitter.Emitter; import io.socket.emitter.Emitter;

Loading…
Cancel
Save