print registry values changed by user to idea.log

This commit is contained in:
nik
2014-08-20 17:51:07 +04:00
parent f04ec45e9d
commit d2acb0cc7d
@@ -16,9 +16,14 @@
package com.intellij.openapi.util.registry;
import com.intellij.openapi.components.*;
import com.intellij.openapi.diagnostic.Logger;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
@State(
name = "Registry",
storages = {
@@ -26,6 +31,7 @@ import org.jetbrains.annotations.NotNull;
file = StoragePathMacros.APP_CONFIG + "/other.xml")}
)
public class RegistryState implements BaseComponent, PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance(RegistryState.class);
public RegistryState() {
}
@@ -36,6 +42,14 @@ public class RegistryState implements BaseComponent, PersistentStateComponent<El
public void loadState(Element state) {
Registry.getInstance().loadState(state);
SortedMap<String, String> userProperties = new TreeMap<String, String>(Registry.getInstance().getUserProperties());
userProperties.remove("ide.firstStartup");
if (!userProperties.isEmpty()) {
LOG.info("Registry values changed by user:");
for (Map.Entry<String, String> entry : userProperties.entrySet()) {
LOG.info(" " + entry.getKey() + " = " + entry.getValue());
}
}
}
@NotNull