log config at start

This commit is contained in:
bancika
2020-09-16 10:21:21 +02:00
parent 57a0425723
commit f2caf0c9fc
4 changed files with 27 additions and 7 deletions
@@ -66,7 +66,7 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
public static final String SNAP_TO_KEY = "snapTo"; public static final String SNAP_TO_KEY = "snapTo";
public static final String CONTINUOUS_CREATION_KEY = "continuousCreation"; public static final String CONTINUOUS_CREATION_KEY = "continuousCreation";
public static final String AUTO_EDIT_KEY = "autoEdit"; public static final String AUTO_EDIT_KEY = "autoEdit";
public static final String ABNORMAL_EXIT_KEY = "abnormalExit"; // public static final String ABNORMAL_EXIT_KEY = "abnormalExit";
public static final String HEARTBEAT = "heartbeat"; public static final String HEARTBEAT = "heartbeat";
public static final String WHEEL_ZOOM_KEY = "wheelZoom"; public static final String WHEEL_ZOOM_KEY = "wheelZoom";
public static final String OUTLINE_KEY = "outline"; public static final String OUTLINE_KEY = "outline";
@@ -3170,6 +3170,10 @@
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Added keyboard shortcuts for zoom in and out using standard Ctrl and +/- key combination and Ctrl+0 to reset to 100%</description> <description>Added keyboard shortcuts for zoom in and out using standard Ctrl and +/- key combination and Ctrl+0 to reset to 100%</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>On MacOS the app registers to open .DIY files</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Improved rendering precision, especially when using metric units</description> <description>Improved rendering precision, especially when using metric units</description>
@@ -3186,10 +3190,6 @@
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Shorten donation label when the window is smaller</description> <description>Shorten donation label when the window is smaller</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>On MacOS the app registers to open .DIY files</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Allow rotate and mirror actions on Pin Header component</description> <description>Allow rotate and mirror actions on Pin Header component</description>
@@ -22,10 +22,12 @@ import java.awt.FontFormatException;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import javax.activity.InvalidActivityException;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@@ -101,6 +103,24 @@ public class DIYLCStarter {
LOG.debug("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version")); LOG.debug("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
LOG.info("Starting DIYLC with working directory " + System.getProperty("user.dir")); LOG.info("Starting DIYLC with working directory " + System.getProperty("user.dir"));
LOG.info("Configuration dump start.");
// log configuration
Field[] fields = IPlugInPort.class.getFields();
for (Field f : fields) {
if (f.getType() != String.class || !f.getName().toUpperCase().equals(f.getName()))
continue;
try {
String key = (String) f.get(null);
Object configValue = ConfigurationManager.getInstance().readObject(key, null);
if (configValue != null && (configValue.getClass() == Boolean.class || configValue.getClass() == String.class)) {
LOG.info(key + " = " + configValue);
}
} catch (Exception e) {
LOG.info("Error logging for field: " + f.getName());
}
}
LOG.info("Configuration dump end.");
try { try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -157,7 +157,7 @@ public class MainFrame extends JFrame implements ISwingUI {
return; return;
} }
if (presenter.allowFileAction()) { if (presenter.allowFileAction()) {
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false); //ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
dispose(); dispose();
presenter.dispose(); presenter.dispose();
LOG.info("Closing the app"); LOG.info("Closing the app");
@@ -172,7 +172,7 @@ public class MainFrame extends JFrame implements ISwingUI {
return; return;
} }
if (presenter.allowFileAction()) { if (presenter.allowFileAction()) {
ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false); //ConfigurationManager.getInstance().writeValue(IPlugInPort.ABNORMAL_EXIT_KEY, false);
dispose(); dispose();
presenter.dispose(); presenter.dispose();
LOG.info("Closing the app"); LOG.info("Closing the app");