Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

master
ju 7 years ago
parent
commit
49279b4725
  1. 2
      designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogAppender.java
  2. 16
      designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  3. 1
      designer-realize/src/com/fr/start/Designer.java
  4. 2
      designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java

2
designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogAppender.java

@ -37,7 +37,7 @@ public class DesignerLogAppender extends AppenderSkeleton {
synchronized (DesignerLogHandler.getInstance()) { synchronized (DesignerLogHandler.getInstance()) {
Level level = event.getLevel(); Level level = event.getLevel();
String msg = this.layout.format(event); String msg = this.layout.format(event);
DesignerLogHandler.getInstance().printRemoteLog(msg, FRLogLevel.convertLog4jToJava(level), new Date()); DesignerLogHandler.getInstance().printRemoteLog(msg, level, new Date());
} }
} }
} }

16
designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -6,14 +6,12 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.FRLogLevel;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.LogRecordTime; import com.fr.general.LogRecordTime;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.xml.LogRecordTimeProvider; import com.fr.stable.xml.LogRecordTimeProvider;
import com.fr.third.apache.log4j.Level;
import javax.swing.*; import javax.swing.*;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
@ -31,15 +29,14 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.logging.Level;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
public class DesignerLogHandler { public class DesignerLogHandler {
protected static final int INFO_INT = Level.INFO.intValue(); protected static final int INFO_INT = Level.INFO.toInt();
protected static final int ERROR_INT = Level.SEVERE.intValue(); protected static final int ERROR_INT = Level.ERROR.toInt();
protected static final int WARN_INT = Level.WARNING.intValue(); protected static final int WARN_INT = Level.WARN.toInt();
private static final int GAP_X = -150; private static final int GAP_X = -150;
private static final int INFO_GAP_Y = -60; private static final int INFO_GAP_Y = -60;
private static final int ERRO_GAP_Y = -40; private static final int ERRO_GAP_Y = -40;
@ -104,6 +101,7 @@ public class DesignerLogHandler {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
JPopupMenu jPopupMenu = new JPopupMenu(); JPopupMenu jPopupMenu = new JPopupMenu();
int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt(); int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt();
if (logLevelInt <= INFO_INT) { if (logLevelInt <= INFO_INT) {
jPopupMenu.add(showInfo); jPopupMenu.add(showInfo);
@ -216,7 +214,7 @@ public class DesignerLogHandler {
} }
public void printStackTrace(String message, Level level, Date date) { public void printStackTrace(String message, Level level, Date date) {
int logLevelvalue = level.intValue(); int logLevelvalue = level.toInt();
if (logLevelvalue == INFO_INT && showInfo.isSelected()) { if (logLevelvalue == INFO_INT && showInfo.isSelected()) {
printMessage(message, logLevelvalue, date); printMessage(message, logLevelvalue, date);
} else if (logLevelvalue == ERROR_INT && showError.isSelected()) { } else if (logLevelvalue == ERROR_INT && showError.isSelected()) {

1
designer-realize/src/com/fr/start/Designer.java

@ -118,6 +118,7 @@ public class Designer extends BaseDesigner {
//传递启动参数 //传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));
designerRoot.start(); designerRoot.start();
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray //初始化一下serverTray
ServerTray.init(); ServerTray.init();

2
designer-realize/src/com/fr/start/module/DesignerWorkspaceProvider.java

@ -20,7 +20,7 @@ public class DesignerWorkspaceProvider extends Activator {
for (String arg : args) { for (String arg : args) {
if (ComparatorUtils.equals(arg, "demo")) { if (ComparatorUtils.equals(arg, "demo")) {
DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
// ServerStarter.browserDemoURL(); ServerStarter.browserDemoURL();
break; break;
} }
} }

Loading…
Cancel
Save