Mercurial > hg > Database > Christie
changeset 88:e4d16deb9627
del Logger
author | akahori |
---|---|
date | Sat, 15 Sep 2018 10:32:33 +0900 |
parents | 33afa0fa8bc5 |
children | 2c22b23fa725 |
files | lib/log4j-1.2.16.jar src/main/java/christie/daemon/Config.java src/main/java/christie/topology/manager/FileParser.java src/main/java/christie/topology/manager/IncomingHosts.java src/main/java/christie/topology/node/IncomingConnectionInfo.java src/main/java/christie/topology/node/Start.java |
diffstat | 6 files changed, 2 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/daemon/Config.java Sat Sep 15 10:30:55 2018 +0900 +++ b/src/main/java/christie/daemon/Config.java Sat Sep 15 10:32:33 2018 +0900 @@ -1,12 +1,9 @@ package christie.daemon; -import org.apache.log4j.Level; - public class Config { public int localPort = 10000; public String logFile = null; - public Level level = Level.FATAL; public String MCSTADDR = "224.0.0.1"; public String nis = "en1"; public boolean useKeepAlive = true; @@ -23,19 +20,6 @@ useKeepAlive = false; } else if ("-a".equals(args[i])) { MCSTADDR = args[++i]; - } else if ("-level".equals(args[i])) { - String levelStr = args[++i]; - if (levelStr.equals("fatal")) { - level = Level.FATAL; - } else if (levelStr.equals("error")) { - level = Level.ERROR; - } else if (levelStr.equals("warn")) { - level = Level.WARN; - } else if (levelStr.equals("info")) { - level = Level.INFO; - } else if (levelStr.equals("debug")) { - level = Level.DEBUG; - } } }
--- a/src/main/java/christie/topology/manager/FileParser.java Sat Sep 15 10:30:55 2018 +0900 +++ b/src/main/java/christie/topology/manager/FileParser.java Sat Sep 15 10:32:33 2018 +0900 @@ -11,8 +11,6 @@ import java.util.HashMap; import java.util.LinkedList; -import org.apache.log4j.Logger; - import com.alexmerz.graphviz.ParseException; import com.alexmerz.graphviz.Parser; import com.alexmerz.graphviz.objects.*; @@ -22,9 +20,6 @@ @Peek TopologyManagerConfig topologyManagerConfig; - private Logger logger = Logger.getLogger(TopologyManager.class); - - @Override protected void run(CodeGearManager cgm) { LinkedList<String> nodeNames = new LinkedList<>(); @@ -71,10 +66,8 @@ } } catch (FileNotFoundException e) { - logger.error("File not found: " + topologyManagerConfig.confFilePath); e.printStackTrace(); } catch (ParseException e) { - logger.error("File format error: " + topologyManagerConfig.confFilePath); e.printStackTrace(); }
--- a/src/main/java/christie/topology/manager/IncomingHosts.java Sat Sep 15 10:30:55 2018 +0900 +++ b/src/main/java/christie/topology/manager/IncomingHosts.java Sat Sep 15 10:32:33 2018 +0900 @@ -6,7 +6,6 @@ import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; import christie.topology.HostMessage; -import org.apache.log4j.Logger; import java.util.HashMap; import java.util.LinkedList; @@ -25,9 +24,6 @@ @Take String MD5; - - private Logger log = Logger.getLogger(IncomingHosts.class); - public IncomingHosts() { } @@ -44,27 +40,18 @@ getDGM(nodeName).put( "nodeName", nodeName); getDGM(nodeName).put("cookie", MD5); - log.info( "toplology manager connected from " + nodeName); LinkedList<NodeInfo> nodeInfoList = resultParse.get(nodeName); getDGM(nodeName).put("connectNodeNum", nodeInfoList.size()); for (NodeInfo nodeInfo : nodeInfoList) { - HostMessage hostMessage = new HostMessage(newHost.hostName, newHost.port, - nodeInfo.connectionName, ""); + HostMessage hostMessage = new HostMessage(newHost.hostName, newHost.port, nodeInfo.connectionName, ""); hostMessage.nodeName = nodeName; hostMessage.remoteNodeName = nodeInfo.targetNodeName; getLocalDGM().put("nodeInfo", hostMessage); - log.info(" write to " + nodeInfo.sourceNodeName + " config message =" + hostMessage.toString() + " remain " - + Integer.toString((nodeNames.size()))); - - cgm.setup(new RecordTopology()); } - - log.info(" remaining configure host = " + Integer.toString(nodeNames.size())); - cgm.setup(new IncomingHosts()); } }
--- a/src/main/java/christie/topology/node/IncomingConnectionInfo.java Sat Sep 15 10:30:55 2018 +0900 +++ b/src/main/java/christie/topology/node/IncomingConnectionInfo.java Sat Sep 15 10:32:33 2018 +0900 @@ -6,7 +6,7 @@ import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; import christie.topology.HostMessage; -import org.apache.log4j.Logger; + public class IncomingConnectionInfo extends CodeGear { @Peek @@ -15,18 +15,11 @@ @Take HostMessage remoteNodeInfo; - private Logger log = Logger.getLogger(IncomingConnectionInfo.class); - - public IncomingConnectionInfo() { } @Override protected void run(CodeGearManager cgm) { - log.info(remoteNodeInfo.toString()); - - log.info("topology node " + nodeName + " will connect to " + remoteNodeInfo.hostName ); - cgm.createRemoteDGM(remoteNodeInfo.connectionName, remoteNodeInfo.hostName, remoteNodeInfo.port); getDGM(remoteNodeInfo.connectionName).put("reverseNodeName", nodeName);
--- a/src/main/java/christie/topology/node/Start.java Sat Sep 15 10:30:55 2018 +0900 +++ b/src/main/java/christie/topology/node/Start.java Sat Sep 15 10:32:33 2018 +0900 @@ -1,20 +1,15 @@ package christie.topology.node; import christie.annotation.Peek; -import christie.annotation.PeekFrom; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; -import christie.test.topology.localTestTopology.LTRemoteIncrement; -import org.apache.log4j.Logger; public class Start extends CodeGear { @Peek String start; - private Logger logger = Logger.getLogger(Start.class); - @Take CodeGear startCG; @@ -24,8 +19,6 @@ @Override protected void run(CodeGearManager cgm) { - logger.info("Configuration finished."); - if (startCG == null) return; cgm.setup(startCG);